• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Layout troubles

 
Aaron Wilt
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
 
Dirk Schreckmann
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.
 
Altaf Ahmad
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic