Home Java Java-get-example Java error icon
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Java error icon

Advertisement
JOptionPane's icon support specify icon to which the dialog displays. We can use four standard icon using JOptionPane icons like question, information, warning, and error).

Java error icon

     

JOptionPane's icon support specify icon to which the dialog displays. We can use four standard icon using JOptionPane icons  like question, information, warning, and error). Each icon have different look and feel and have its  own versions of the four standard icons. The following given example shows you  the icons used in the Windows in java ..

In this Tutorial we want to describe you a code that explains you in understanding an error icon. For this we have a class name java error icon. Inside the main method we assign a memory to the instance of JOptionalPane swing. The JOptionalPaneswing help us in implementation of a customized icon,image,dialog box etc.

1)JOptionPane.showMessageDialog(null,"Error dialog box Demo"," ".JOptionPane.ERROR_MESSAGE)-This return you an customized Title and an error icon.

javaerroricon.java

import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class javaerroricon extends JPanel{

  public static void main(String[] args) {
  JOptionPane jop = new JOptionPane();
 
  JOptionPane.showMessageDialog(null, "Error dialog box Demo""",
  JOptionPane.ERROR_MESSAGE);
  }

}
 

On execution of the above preceding code ,this will show you an error icon.
Output


Download code

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 3, 2008

Related Tutorials

Ask Questions?    Discuss: Java error icon  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com