• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem re-opening a JFrame

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JFrame that uses the GridBag Layout.
In one of the cells, I have a JPanel which used a GridLayout.
When I open the JFrame for the first time, everything look great.
I even have an "Add" button that adds data to the inner JPanel.
The entire JPanel is re-created everytime I hit the "Add" button.
This work fine, but when I close the JFrame and reopen it,
The inner JFrame does not render correctly. It seems to be out of place
and undersized.
Any Ideas?
When I close and reopen the JFrame, I recreate a new JFrame and JPanel.
Could the old one be affecting it?
Note, the JPanel is a private member of my JFrame class.
Thanks,
Terrence
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Terrence,
Your description is somewhat imprecise; maybe you could show us (possibly abridged!) code that displays the symptoms. Use the UBB CODE tag, please!
 
Terrence White
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might be difficult to put the code here, so I'll restate the question.
Do you know of any problems nesting a GridBagLayout?
For example, I have a JFrame whose layout is GridBag.
In on of the cells, I want to add a JPanel whose layout is also GridBag.
Thanks,
Terrence
 
reply
    Bookmark Topic Watch Topic
  • New Topic