Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with JOptionPane.

843807Oct 8 2009 — edited Oct 8 2009
import  javax.swing.JOptionPane;

public class test1
{
	public static void main(String args[])
	{
		JOptionPane.showMessageDialog(null,"Hello world",JOptionPane.PLAIN_MESSAGE);
	}
}
By compiling the above code it is giving the following error:

test1.java:7: cannot find symbol
symbol : method showMessageDialog(<nulltype>,java.lang.String,int)
location: class javax.swing.JOptionPane
JOptionPane.showMessageDialog(null,"Hello world",JOptionPane.PLA
IN_MESSAGE);
^
1 error

Can anyone help me about this?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2009
Added on Oct 8 2009
8 comments
423 views