File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Static / Dynamic JButtons and JPanels" Watch "Static / Dynamic JButtons and JPanels" New topic

Static / Dynamic JButtons and JPanels

Tim Vanderbelt

Joined: Jun 20, 2005
Posts: 2

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?
I agree. Here's the link:
subject: Static / Dynamic JButtons and JPanels
It's not a secret anymore!