So, I have a popup dialog box in the application that informs the user about the program. Everything went well until the user icon. Here is what I tried:
Attempt 1:
JOptionPane.showMessageDialog(dialog, "Blah blah blah", "About", JOptionPane.INFORMATION_MESSAGE, new ImageIcon("home/user/Pictures/default.jpg"));
Attempt 2:
final icon = new ImageIcon("home/user/Pictures/default.jpg"));
JOptionPane.showMessageDialog(dialog, "Blah blah blah", "About", JOptionPane.INFORMATION_MESSAGE, icon);
Attempt 3:
final icon = new ImageIcon("home/user/Pictures/default.jpg"));
showMessageDialog(dialog, "Blah blah blah", "About", JOptionPane.INFORMATION_MESSAGE, icon);
Attempt 4:
(Scream in java)
Attempt 5:
URL usage
All did not affect the program, and instead of the image I get nothing.
Details:
- With no exceptions
- File path exists
- My IDE does not return exceptions, NOR any warnings of any kind
- Yes, I also set the path /home/user/Pictures/default.jpg
- .ico, .png, .jpg do not work. I'm not so sure about .gif right now, though.
Help me!: (
user569322
source
share