aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Refresh with fresh components in a JFrame at Runtime 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 » Swing / AWT / SWT
Bookmark "Refresh with fresh components in a JFrame at Runtime" Watch "Refresh with fresh components in a JFrame at Runtime" New topic
Author

Refresh with fresh components in a JFrame at Runtime

ritesh r
Greenhorn

Joined: Jul 19, 2001
Posts: 24
Hi All:
I want a immediate solution to a problem .
I am unable to hide or remove the componets.
Let me elaborate:
I have a menubar with Add Issue & view Issue as SubItems with ItemListeners enabled.
Now I am facing a problem.Both these Menuitems are different methods developed by me to handle the laying of these components.
Whenever I click the Add Issue,the addDisplay() method is fired and the components laid out.
Now when I click the View Issue,the ViewDisplay() method is fired,but the components are overlapped.
Help me.Does swing support a functionality where the components are hidden and enabled when clickedd.
Regards
Ritesh
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

You might try
myComponent.setVisible(boolean)??
This hides and shows the component without actually disposing of it.

GenRocket - Experts at Building Test Data
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Refresh with fresh components in a JFrame at Runtime