Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to Resolve Symbol Errors

 
A McDonald
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to convert and application class (Frame) to an Applet. I have a fairly well defined set of steps to use to do this. After the first round of edits, I tried to compile and got a bunch of Unable to Resolve Symbol errors for library functions as well as for package level classes. I can still compile the original class, and I changed no code on the lines in the edited version that produce the errors. And the imports are still there...I don't understand how the same lines can compile in one class, but not in another...
 
Brian McCallister
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question is a bit too vague. It is fairly easy to lose symbol references - especially if you change the base class of somehting from a JFrame to an Applet and start calling Swing related methods on it.
-Brian
 
A McDonald
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok...since I did change the base class from Frame to Applet, and now am having this problem, do you have any suggetions? I'm not calling any new library methods, I just added an init() method and made a few other minor changes...
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We would need to see the code.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy, I can not tell from the 1200 lines of code that you sent me which lines that you changed, and I do not have a clue WHICH classes are being flagged in your error messages. Needless to say, I can not compile your code since I do not have all of the classes that it relies on.
Remember that Frame extends Window and therefore inherits all the methods of Window.
Applet extends Panel. While both Window and Panel are Containers they have different methods etc.
That is the first place that I would look for a problem.
For instance setMenuBar(MenuBar mb) is a method of Frame. It just does not exist in Applet so you can not call it.
Also a call to super must be the first line of a constructor. Obviously you can not call the Frame super constructor if this is an Applet. You are trying to set the title for this Applet, however a title is a thing that an outer Container like a Window or a Frame has. Panels and Applets are inner Containers and do not HAVE things like titles, minimize buttons, their own menubars etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic