This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "cant reuse panel?" Watch "cant reuse panel?" New topic

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?

[ 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?

subject: cant reuse panel?
Similar Threads
JFrame's icon
problem with ActionListener of jTextField
Problem with custom painting and multiple JPanel
centering a dialog
jspinner background color