Results 1 to 2 of 2
Thread: GridBagLayout...please help
- 02-16-2008, 04:40 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 16
- Rep Power
- 0
GridBagLayout...please help
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?
Thanks.
- 02-17-2008, 01: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.
Similar Threads
-
GridBagLayout
By newtojava7 in forum New To JavaReplies: 2Last Post: 03-07-2008, 12:16 AM -
Problems with gridBaglayout when I resize the window
By Iyengar in forum AWT / SwingReplies: 1Last Post: 02-16-2008, 11:43 PM -
Need a idea on GridBagLayout
By ddsuresh in forum AWT / SwingReplies: 1Last Post: 01-29-2008, 01:32 AM -
gridbaglayout
By newtojava7 in forum New To JavaReplies: 4Last Post: 01-27-2008, 08:03 PM -
Problem with GridBagLayout
By Daniel in forum SWT / JFaceReplies: 2Last Post: 07-01-2007, 06:57 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks