This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot find symbol

 
jonelo piad
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the error here
i'm new to java so i don't know where

 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jonelo: Please post the exact error message. "Cannot find symbol" means that you are using a variable name, or a class name or method name, that the compiler doesn't know. Maybe you are using a variable that has not been declared, or a method or class that doesn't exist. It could also be a spelling mistake in a name.

The error message from the compiler tells you exactly in which line of your source code the error happens and which name the compiler doesn't understand. Look carefully at the error message, go to that line in your source code and check what's wrong there.
 
Campbell Ritchie
Sheriff
Posts: 48448
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have added the code tags, and you can see how much better the code looks. I have also removed unnecessary blank lines. There is something not right about that design. You would usually have all the components as local methods in a constructor for the class, or an initGUI() method. That should set up all the components, layout, etc. I worry about seeing addActionListener(this), which often means people have got their hands on a resource which does not teach proper OO programming.
Suggest
  • 1: Get the logic of your application working with a command‑line program. Don’t even think of creating a GUI until that works well.
  • 2: Create a class which connects to the application, passing calls to its different methods.
  • 3: Create a class which displays the GUI; it would have all the components as local variables in its initGUI method or constructor.
  • 4: Create listener classes for each kind of listener.
  • That is only a simplification of the process.

    I shall move this thread, because it would fit better into our GUIs forum.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic