Search:

Type: Posts; User: Norm

Search: Search took 0.15 seconds.

  1. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    Get rid of the NumbersTest class and use the Display class.
  2. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    I think the link I posted in #10 discusses this. The Display class is an inner class. You need an instance of the NumbersTest class to be able to create a Display class object.

    Why not get rid of...
  3. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    Out of an inner, non static class.

    Why do you have the NumbersTest class?
  4. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    That says what the problem is. A static method can only be in a static or top level class.
    Move the main method or make the class it is in static.

    Why do you have the NumbersTest class?

    Why...
  5. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    You can read here about nested and inner classes:
    Nested Classes (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

    You need to decide if you want either of those or if you...
  6. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    You would need a reference to the instance of the Display class.

    Your nested classes will be a problem. An inner class would be able to see the variables of the class that it is in.
    The static...
  7. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    What class is the paintComponent method in?

    Also you need to set String that is to be shown. The handlers are only setting a local variable.
  8. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    objectReference.repaint();
  9. Thread: More GUI help

    by Norm
    Replies
    20
    Views
    1,608

    Re: More GUI help

    Calling repaint() will cause the java program to call the paintComponent method very soon afterwards.
    You will have to tell the paintComponent method what String you want it to draw.
Results 1 to 9 of 9