problem with JButton objects creation
|
| View previous topic :: View next topic |
| Author |
Message |
Ikopar
Joined: 26 May 2006 Posts: 168
|
If I have a class that extends JPanel, why am I only allowed to create JButton objects in the constructor of this base class and not in other methods of the class?
To be more clear, creating and adding buttons shows no changes in the actual window. |
| |
|
|
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| Ikopar, can't you do it with the this.add()? |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| i just have an inner class that calls add() directly. |
| |
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| Add on the base class? |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
| The base class extends JPanel, and the performs add() in the inner class of the base class. |
| |
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| Ikopar: i don't know wtf you just said |
| |
|
|
Ikopar
Joined: 26 May 2006 Posts: 168
|
Right, let me rephrase that.
The base class, FOO, extends JPanel. inside the base class I have an inner class which calls the add() function of the base class, FOO. |
| |
|
|
|
|