• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error !! in Swing  RSS feed

 
Mark Henryson
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the following error. Why??
I am trying this codings from Head First Java Book. Page no:342 (First Edition)


Error message:
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A tip I have found useful - if you get a compiler error that points to a line of code, and you can't see any error on that line, check the previous line.

In this case, on the previous line you have an extra close brace }.
This is making the compiler think you are marking the end of the class when you aren't. You need to delete this brace and move it to the place where your class really does finish.
[ August 19, 2005: Message edited by: Ernest Friedman-Hill ]
 
Mark Henryson
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But, I am still getting the error message.



Error Message:
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a } after f.setVisible(true);
You can't have a method inside another method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!