Results 1 to 3 of 3
Thread: GridBagLayout
- 02-16-2008, 03:05 AM #1
Member
- Join Date
- Jan 2008
- Posts
- 16
- Rep Power
- 0
GridBagLayout
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-16-2008, 08:08 PM #2
Member
- Join Date
- Jan 2008
- Location
- South Africa
- Posts
- 18
- Rep Power
- 0
With GridBagLayout I reccomend you use a Swing builder, such as the one in NetBeans. Its just easier.
- 03-07-2008, 12:16 AM #3
Member
- Join Date
- Dec 2007
- Posts
- 17
- Rep Power
- 0
Hi NewtoJava7
to create a new gridlayout use the following
setLayout(new GridLayout(3,1)) this will great a gridlayout of 3 row and 1 colum. The default layou of a container is a boarderlayout so it has a north east south west. if you say west.setLayout(new GridLayout(3,1)) that will change the west portion of the boarder layout to a GridLayout with 3 row and 1 colum
Similar Threads
-
GridBagLayout...please help
By newtojava7 in forum Advanced JavaReplies: 1Last Post: 02-17-2008, 01: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