• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

fixed element in gridbaglayout

 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I want the components of the GUI on the top-left and I don't want them to move to right when the window is resized.



Thanks.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
not a gridbaglayout solution, but a nested flowLayout panel might be good enough

 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Leandro, please read this link on cross-posting: BeForthrightWhenCrossPostingToOtherSites
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Leandro, please read this link on cross-posting: BeForthrightWhenCrossPostingToOtherSites

Thanks, another added to my personal 'ignore-in-future' list
 
Leandro Coutinho
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Michael Dunn
Don't you like to use direct in the frame?
eg:
why did you do this:
JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
p.add(gbPanel);
frame.add(p);

instead of this:

frame.setLayout(new FlowLayout(FlowLayout.LEFT));
frame.add(gbPanel);

I always have this doubt, if it is better put the components in a panel and then in the frame, or if I can put direct in the frame.
you that have much knowlodge, what do you recomend? do you have some tip?

I could manage to resolve this problem without the workaround.
 
Leandro Coutinho
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

pete stein wrote:Leandro, please read this link on cross-posting: BeForthrightWhenCrossPostingToOtherSites


ok, I didn't know this politic
 
Sheriff
Posts: 22716
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Leandro Coutinho wrote:

pete stein wrote:Leandro, please read this link on cross-posting: BeForthrightWhenCrossPostingToOtherSites


ok, I didn't know this politic


Then perhaps http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch is a good read for you.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic