Board index » jbuilder » Removing Componets from a frame

Removing Componets from a frame


2004-04-13 11:07:21 PM
jbuilder5
How do you remove componets like JTextPane, JSlider ect. Including the listners.
I'm using 1 frame to display various componets, that can change, the problem is clearing them for (memory usage, and the display)
I might add, that I alson will recall the very same componets at a later time. So if there is a good way to remove them without having to go through all the init would be great, but not important.
 
 

Re:Removing Componets from a frame

Joe wrote:
Quote

How do you remove componets like JTextPane, JSlider ect. Including the
listners.

I'm using 1 frame to display various componets, that can change, the
problem is clearing them for (memory usage, and the display) I might add,
that I alson will recall the very same componets at a later time. So if
there is a good way to remove them without having to go through all the
init would be great, but not important.
Do you at runtime or design time?
At runtime, it would be better to use nested panels for something like this,
and to remove your listeners from the frame and use another class to
implement the listener interfaces you are going to call/use through the
derivate class.
Sounds like you need to have a look at the swing tutorial on the Sun site