• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Layout troubles

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all-
I'm having some trouble with the layouts. What I want to do seems relatively simple, but it's giving me all sorts of fits. I've got an applet with the dimensions 500 x 805. I have 2 jlabels, 2 jcomboboxes, and 1 jbutton components that I want them added vertically to the right-hand side of my applet (basically where (x > 440) && (x < 500).
Which layout is the best to use? I've read through some docs, but found it hard to construct what I'm after. BorderLayout seems to make the most sense, although you can only have 1 component on each direction... Any pointers or help you could provide would be most excellent!
Thanks,
Aaron
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if you were to add these components to a Panel (or JPanel) and then add that one Panel to your BorderLayout? Note: Be sure to set the layout of the Panel appropriately.
Good Luck.
[ April 30, 2002: Message edited by: Dirk Schreckmann ]
 
Aaron Wilt
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could certainly try that. I don't have much experience using JPanels, but I'll read up on them and try that out. Thanks for the prompt response. I'd welcome any other opinions or advice as well!
Thanks,
Aaron.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, make a panel and use GridLayout (for your buttons, etc.) on it. That will get your objects in a row/column format. Then, add that panel to the East region of another container (panel? contentpane?) that has a BorderLayout. That'll make your control bar stick to the right.
Altaf
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic