I would like to make use in a normal JDialog of the information icon provided by the JOptionPane.INFORMATION_MESSAGE. Is it possible?
Asked
Active
Viewed 2,490 times
1 Answers
9
Currently in the JOptionPane source code (rather in its UI, actually), this is done by retrieving this property:
return (Icon)DefaultLookup.get(optionPane, this, "OptionPane.informationIcon");
Outside of a UI code, though, you simply need to call:
UIManager.getIcon("OptionPane.informationIcon")
Note however that the icon returned depends on the current Look & Feel.
Out of curiosity, the other resources are:
- "OptionPane.errorIcon"
- "OptionPane.warningIcon"
- "OptionPane.questionIcon"

Gnoupi
- 4,715
- 5
- 34
- 50