Re: using JOptionPane's error icon
- From: Roland <roland@xxxxxxxxx>
- Date: Wed, 27 Apr 2005 11:34:26 +0200
On 27-4-2005 6:37, hkongogo@xxxxxxxxx wrote:
I'm writing my own error msg dialog and want to use the JOptionPane's error icon. Pls help
UIManager.getIcon("OptionPane.errorIcon");For other icons, see following program:
import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.UIManager;
public class OptionPaneIcons { public static void main(String[] args) { JPanel jContentPane = new JPanel();
jContentPane.setLayout(new FlowLayout()); JLabel jLabel1 = new JLabel();
jLabel1.setIcon(UIManager.getIcon("OptionPane.questionIcon"));
jContentPane.add(jLabel1, null); JLabel jLabel2 = new JLabel();
jLabel2.setIcon(UIManager.getIcon("OptionPane.warningIcon"));
jContentPane.add(jLabel2, null); JLabel jLabel3 = new JLabel();
jLabel3.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
jContentPane.add(jLabel3, null); JLabel jLabel4 = new JLabel();
jLabel4.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
jContentPane.add(jLabel4, null); JFrame application = new JFrame();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
application.setContentPane(jContentPane);
application.pack();
application.setLocationRelativeTo(null);
application.setVisible(true);
}
}
--
Regards,Roland de Ruiter ___ ___ /__/ w_/ /__/ / \ /_/ / \ .
- Follow-Ups:
- Re: using JOptionPane's error icon
- From: trung pham dinh via JavaKB.com
- Re: using JOptionPane's error icon
- References:
- using JOptionPane's error icon
- From: hkongogo@xxxxxxxxx
- using JOptionPane's error icon
- Prev by Date: Re: using JOptionPane's error icon
- Next by Date: Re: using JOptionPane's error icon
- Previous by thread: Re: using JOptionPane's error icon
- Next by thread: Re: using JOptionPane's error icon
- Index(es):