aspose file tools*
The moose likes Beginning Java and the fly likes Can anyone please help?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can anyone please help??" Watch "Can anyone please help??" New topic
Author

Can anyone please help??

yue feng
Greenhorn

Joined: Mar 12, 2002
Posts: 5
I am trying to remove all the components from my frame(instance of jframe class) and then add everything to it again. what i used is removeAll() function(after that, i rerendered everyone back on my frame again). however, once i add this function, all my components would not show up, and even the frame was minimized when starting the program. does anyone have any idea why?
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Hello,
I'm not up to par with Swing enough, but here's a stab at things using the AWT...
This does what you might be attempting to do (though using the AWT - not Swing):

If you were to post some code (in the simplest form necessary) to replicate what you're attempting to do...
Good Luck.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
yue feng
Greenhorn

Joined: Mar 12, 2002
Posts: 5
Thanks for your reply, but for some reason, i have to use swing other than awt. Does anyone else have any suggestions?
Thanks a lot in advance
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Originally posted by Dirk Schreckmann:
If you were to post some code (in the simplest form necessary) to replicate what you're attempting to do...
Brent Worden
Ranch Hand

Joined: Nov 26, 2001
Posts: 50
Originally posted by yue feng:
I am trying to remove all the components from my frame(instance of jframe class) and then add everything to it again. what i used is removeAll() function(after that, i rerendered everyone back on my frame again). however, once i add this function, all my components would not show up, and even the frame was minimized when starting the program. does anyone have any idea why?

After you call removeAll, make sure you re-add each component to the frame:
frame.getContentPane().removeAll();
// need to add components back to frame:
frame.getContentPane().add(component1);
frame.getContentPane().add(component2);
frame.getContentPane().add(component3);
//...


Brent Worden
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can anyone please help??