Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swing - Buttons Vertically

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi, i m writing a swing application, and i want to put some buttons vertically, without using GridBagLayout. My problem is that each button's size is as long as its label, but i want them all to be similar. Is there a solution, without using GridBagLayout - its for my exams, thats why i cant use it :(
 
try using just a normal grid layout and give it a column size of 1, that way as you arrange your buttons they will be added vertically.

The grid layout will be better as the button sizes are kept uniform throughout (smaller buttons will grow to match the size of the largest required.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top