aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Static / Dynamic JButtons and JPanels Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Static / Dynamic JButtons and JPanels" Watch "Static / Dynamic JButtons and JPanels" New topic
Author

Static / Dynamic JButtons and JPanels

Tim Vanderbelt
Greenhorn

Joined: Jun 20, 2005
Posts: 2
Hello,

I am creating a java application that contains numerous 50+ Panels (JPanels) and each panel could contain upto 40 buttons (JButtons). Is it better to have a static instance of each panel (and buttons) or create it dynamically and allow the garbage collector to do its job? Would the static case use a lot of memory? Which instance would be faster?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Static / Dynamic JButtons and JPanels
 
Similar Threads
images with swing
resize buttons dynamically
Applet with sliding buttons.
Which JPanel is the button on
JButton slow response time