How to display an icon on JOptionPane.showInputDialog() in Java?
- by Lion
The following segment of code shows JOptionPane.showInputDialog() method. It works fine but I need to display a custom icon on it. I currently left it null as shown below.
String operatingSystem = System.getProperty("os.name");
Object o[] = {"Turn Off", "Restart", "Stand By", "Log Off"};
Frame frame = new Frame(operatingSystem);
Object selectedValue = JOptionPane.showInputDialog(frame,
"What would you like to do with the system?", "Select a task",
JOptionPane.INFORMATION_MESSAGE, null, o, o[0]); //<---- Here it is.
How can an icon be displayed on it replacing null?