• 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

Gridbaglayout problom

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ranchers,
i needs a frame with 5 panels.
i m using GridBagLayout as layout manager for my frame
One of my panel uses GridLayout.
One of my panel uses GridBagLayout.
Rest of the panels does'nt need any layuot(default,Flowlayout).
First i added 5 empty panels for correcting the location of each panel.i made a nice skeleton for adding the panels(positioning is over)
then i replaced temporary panels with 'original' panels.but when i add the panel which uses GridLayout,the propotion of frame changed undesirably.The same problom occured when i tried to add my gridbaglayout panel.
do i need to specify setSize() for each panel?.
basha
 
basha khan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anybody have any idea??.it's urgent.
basha
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try setPreferredSize( Dimension )... FlowLayout honours each component's preferred size.
 
basha khan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi nate,
but i wanna stretch some componets.
Even though i 've tried in all the way. even i tried with setSize() on each component.
I just dont getting the problom.i read all the topics /tutorials availeable on this issue.none of them pointing to the real problom.
There is something unknown in GridBagLayout.The stretching strategy of this layout is not straightforward as documentation says.Dont getting answer from any tutorials/topics.
Either i 've to find the solution or the real problom.
basha
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post your current code for the top level container? Maybe I can figure something out if I see what constraints you are using on your GridBagLayout...
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic