I'm trying to create a piece of code that displays either a smiley face or a sad face when a button is pressed, depending on some value, but it just won't display the image. I know that it's definitely getting past the if/else statements, so I really don't know what is going wrong.
try {
if(data[2] <= ((int) ChronoUnit.DAYS.between(localDate, RTS()))*MnHrs())
{
JLabel lblSmiley = new JLabel(new ImageIcon("C:\\. . .\\smileyface.jpeg"));
panel.add(lblSmiley);
}
else
{
JLabel lblSmiley = new JLabel(new ImageIcon("C:\\ . . . \\sadeface.png));
panel.add(lblSmiley);
}
} catch (Exception e1) {
e1.printStackTrace();
}