Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems after import javax.swing.*

 
jimmy hakka
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the following is a program in a book:
import javax.swing.* ;
public class Welcome
{
public static void main(String[]grav){
JOptionpane.showMessageDialog(
null,
"Welcome to the wonderful world of Java!",
"Welcome,new programmer",
JOptionpane.PLAIN_MESSAGE);
System.exit(0);
}
}
then when I:
c:>javac Welcome.java
there were errors return:
Welcome.java:10: cannot resolve symbol
symbol : variable JOptionpane
location: class Welcome
JOptionpane.PLAIN_MESSAGE);
^
Welcome.java:6: cannot resolve symbol
symbol : variable JOptionpane
location: class Welcome
JOptionpane.showMessageDialog(
^
2 errors
what can I do?
thx.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Capitalize the 'p' in JOptionPane, that's all.
kind regards
 
jimmy hakka
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,my friend.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, jimmy!
Note that to help preserve formatting of posted code and error messages you can surround it with the [code] and [/code] UBB tags.
Good luck and I hope to see you 'round the Ranch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic