JOptionPane defines icons for different types of messages. I want to use my own icons.
Can I use my own icon specific to my application with JOptionPane?
Printable View
JOptionPane defines icons for different types of messages. I want to use my own icons.
Can I use my own icon specific to my application with JOptionPane?
To change all JOptionPanes try
Before you create any dialogs.Code:ImageIcon icon = yourIcon
UIManager.put(icon, "OptionPane.informationIcon");
Other string properties: errorIcon, questionIcon, warningIcon.
Thanks. But where I have to mention the image name and path?
See ImageIcon class api Constructors Summary section for other options.Code:ImageIcon icon = new ImageIcon(new File(imagePath));