wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes cant reuse panel? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "cant reuse panel?" Watch "cant reuse panel?" New topic
Author

cant reuse panel?

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i wrote this panel that contains an exit button:

with the idea that i could add it to several panels in order to reuse it, but it works only once

in my main app i have:


How can i turn this around?

TiA
[ March 25, 2007: Message edited by: miguel lisboa ]

java amateur
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
that was really helpful, Craig, ty!

from what i understand one has to use the button, not the panel that supports it, to add it to the various panels one wants it to be added to

one note: i'm using eclipse (and null layout for the main panels):
on the JavaBeans panel (when one uses the visual editor), the button appears with a white cross with red background, and more, does not show in visual editor pane (i mean, inside my app, near my lists, buttons and so on)
is there a way to fix it?

TiA
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: cant reuse panel?
 
Similar Threads
JFrame's icon
jspinner background color
problem with ActionListener of jTextField
Problem with custom painting and multiple JPanel
centering a dialog