File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOptionPane problems

 
James Brooks
Gunslinger
Ranch Hand
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

If mySB is a stringbuffer, what is wrong with the following declaration? Error messages are:
C:\Documents and Settings\Owner.Mynotebook\Ch5ItIs\src\ch5itis\Chapter7Strings.java:29: <identifier> expected
JOptionPane.showMessageDialog(null, "The user ID is " + mySB);
C:\Documents and Settings\Owner.Mynotebook\Ch5ItIs\src\ch5itis\Chapter7Strings.java:29: illegal start of type
JOptionPane.showMessageDialog(null, "The user ID is " + mySB);
2 errors

 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Patrick Brooks:
...what is wrong with the following declaration? ...

It's not a declaration -- it's a method call. Nothing is wrong that that line of code, but it needs to be inside the body of a method.
 
James Brooks
Gunslinger
Ranch Hand
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was inside valid code, but when I closed NetBeans and reopened, it compiled and ran just fine. Strange.


-Patrick
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic