tags:

views:

44

answers:

1
+3  Q: 

Information icon

I would like to make use in a normal JDialog of the information icon provided by the JOptionPane.INFORMATION_MESSAGE. Is it possible?

+5  A: 

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