Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Information icon

Tags:

java

swing

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

like image 516
Anto Avatar asked Jun 28 '10 14:06

Anto


1 Answers

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"
like image 116
Gnoupi Avatar answered Oct 29 '22 00:10

Gnoupi