Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Componet Allignment

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having a problem being able to get my botton Jbuttons to allign properly, they are just lined up in a row at the bottom of my JFrame but I want it to appear more like

NextCust NextAcct Search
Add Update Delete Exit


 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What we can do to get this kind of layout

Options and possibilities:
1 — add the buttons in each row to a separate JPanel with FlowLayout and add these two JPanels to buttonPanel with a GridLayout(2,0) or a BorderLayout (using north and south sections)

2 – you could use the two JPanels but try a GridLayout in each JPanel instead of FlowLayout. One of the GridLayout constructors has an hgap and vgap option.

3 — again with the two JPanels you could try a GridBagLayout or a BoxLayout in each one. These two layout managers are more advanced...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic