Results 1 to 2 of 2
Thread: GridBagLayout...please help
- 02-16-2008, 05:40 PM #1Member
- Join Date
- Jan 2008
- Rep Power
Hello, I'm curious as to how to set the number of rows and columns using the GridBagLayout so I can set my components in the appropriate place. Right now I've created a label and it is appearing right smack in the middle, leading me to believe the default is a 1 row 1 column set up, I may be wrong. How can I change the number of rows and columns and manipulate their sizes?
- 02-17-2008, 02:16 AM #2
How can I change the number of rows and columns and manipulate their sizes?
GridBagLayout determines the number of columns and rows from the number of components you give it to layout and the constraints of the components. If you
add four buttons with the default constraints it will try to lay them out in a single row of four columns. If you specify the gridwidth constraint as GridBagConstraints.REMAINDER for all the buttons it will try to lay them out in four rows and a single column. The weight constraints allow the component display areas to occupy extra space and/or to be anchored in different locations within their display area. See the GridBagLayout class api for details.
- By newtojava7 in forum New To JavaReplies: 2Last Post: 03-07-2008, 01:16 AM
- By Iyengar in forum AWT / SwingReplies: 1Last Post: 02-17-2008, 12:43 AM
- By ddsuresh in forum AWT / SwingReplies: 1Last Post: 01-29-2008, 02:32 AM
- By newtojava7 in forum New To JavaReplies: 4Last Post: 01-27-2008, 09:03 PM
- By Daniel in forum SWT / JFaceReplies: 2Last Post: 07-01-2007, 07:57 PM