Results 1 to 2 of 2
  1. #1
    newtojava7 is offline Member
    Join Date
    Jan 2008
    Posts
    16
    Rep Power
    0

    Default 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.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    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

  1. GridBagLayout
    By newtojava7 in forum New To Java
    Replies: 2
    Last Post: 03-07-2008, 12:16 AM
  2. Replies: 1
    Last Post: 02-16-2008, 11:43 PM
  3. Need a idea on GridBagLayout
    By ddsuresh in forum AWT / Swing
    Replies: 1
    Last Post: 01-29-2008, 01:32 AM
  4. gridbaglayout
    By newtojava7 in forum New To Java
    Replies: 4
    Last Post: 01-27-2008, 08:03 PM
  5. Problem with GridBagLayout
    By Daniel in forum SWT / JFace
    Replies: 2
    Last Post: 07-01-2007, 06:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •