GridBagLayout

Discussion in 'Java' started by Brian, May 7, 2008.

  1. Brian

    Brian Guest

    Hi

    I'm trying to create a GUI using GridBagLayout.

    I have two separate JPanels where i need to place items in the same
    place in each panel.

    Is it possible to use at GridBagLayout with a fixed / predifined no.
    of colums - and all of them with the same width?

    /Brian
     
    Brian, May 7, 2008
    #1
    1. Advertising

  2. Brian wrote:
    > Hi
    >
    > I'm trying to create a GUI using GridBagLayout.
    >
    > I have two separate JPanels where i need to place items in the same
    > place in each panel.
    >
    > Is it possible to use at GridBagLayout with a fixed / predifined no.
    > of colums - and all of them with the same width?
    >
    > /Brian


    Maybe. GBL is very dependent on the preferred sizes of the components.
    So if they were all the same size or you make them all the same size,
    then yes probably. Also with GBL you can set the weights and fill to
    allow the components to expand to the available space in the layout.

    I wrote a GBL simulator if you want to try setting up a layout,

    http://rabbitbrush.frazmtn.com/gridbagtester.html

    If you try it, I would appreciate any feedback.

    --

    Knute Johnson
    email s/nospam/linux/

    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    Knute Johnson, May 7, 2008
    #2
    1. Advertising

  3. Brian wrote:
    > Hi
    >
    > I'm trying to create a GUI using GridBagLayout.
    >
    > I have two separate JPanels where i need to place items in the same
    > place in each panel.
    >
    > Is it possible to use at GridBagLayout with a fixed / predifined no.
    > of colums - and all of them with the same width?
    >


    That sounds more like GridLayout than GridBagLayout.

    --
    RGB
     
    RedGrittyBrick, May 8, 2008
    #3
  4. Brian

    Guest

    On May 7, 1:29 pm, Knute Johnson <>
    wrote:
    > Brian wrote:
    > > Hi

    >
    > > I'm trying to create a GUI using GridBagLayout.

    >
    > > I have two separate JPanels where i need to place items in the same
    > > place in each panel.

    >
    > > Is it possible to use at GridBagLayout with a fixed / predifined no.
    > > of colums - and all of them with the same width?

    >
    > > /Brian

    >
    > Maybe. GBL is very dependent on the preferred sizes of the components.
    > So if they were all the same size or you make them all the same size,
    > then yes probably. Also with GBL you can set the weights and fill to
    > allow the components to expand to the available space in the layout.
    >
    > I wrote a GBL simulator if you want to try setting up a layout,
    >
    > http://rabbitbrush.frazmtn.com/gridbagtester.html
    >
    > If you try it, I would appreciate any feedback.
    >
    > --
    >
    > Knute Johnson
    > email s/nospam/linux/
    >
    > --
    > Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    > ------->>>>>>http://www.NewsDemon.com<<<<<<------
    > Unlimited Access, Anonymous Accounts, Uncensored Broadband Access


    I tried it - really awesome.

    The only suggestion is to create function to export created layout in
    Java source format. It will really help developers to visually crate
    layout and then use it.

    Nice job!

    Alex.
    http://www.myjavaserver.com/~alexfromohio/
     
    , May 8, 2008
    #4
  5. wrote:
    > On May 7, 1:29 pm, Knute Johnson <>
    > wrote:
    >> Brian wrote:
    >>> Hi
    >>> I'm trying to create a GUI using GridBagLayout.
    >>> I have two separate JPanels where i need to place items in the same
    >>> place in each panel.
    >>> Is it possible to use at GridBagLayout with a fixed / predifined no.
    >>> of colums - and all of them with the same width?
    >>> /Brian

    >> Maybe. GBL is very dependent on the preferred sizes of the components.
    >> So if they were all the same size or you make them all the same size,
    >> then yes probably. Also with GBL you can set the weights and fill to
    >> allow the components to expand to the available space in the layout.
    >>
    >> I wrote a GBL simulator if you want to try setting up a layout,
    >>
    >> http://rabbitbrush.frazmtn.com/gridbagtester.html
    >>
    >> If you try it, I would appreciate any feedback.
    >>
    >> --
    >>
    >> Knute Johnson
    >> email s/nospam/linux/
    >>
    >> --
    >> Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    >> ------->>>>>>http://www.NewsDemon.com<<<<<<------
    >> Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

    >
    > I tried it - really awesome.
    >
    > The only suggestion is to create function to export created layout in
    > Java source format. It will really help developers to visually crate
    > layout and then use it.
    >
    > Nice job!
    >
    > Alex.
    > http://www.myjavaserver.com/~alexfromohio/


    That's a good idea, I'll think about that.

    --

    Knute Johnson
    email s/nospam/linux/

    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    Knute Johnson, May 8, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Passero

    grid or gridbaglayout

    Passero, Jul 2, 2003, in forum: Java
    Replies:
    3
    Views:
    3,120
    dhek bhun kho
    Jul 2, 2003
  2. me
    Replies:
    2
    Views:
    4,533
    Sudsy
    Jul 21, 2003
  3. David McCallum

    GridBagLayout Example

    David McCallum, Oct 23, 2003, in forum: Java
    Replies:
    0
    Views:
    698
    David McCallum
    Oct 23, 2003
  4. John Davison

    Viewing GridBagLayout's Grid Lines?

    John Davison, Dec 9, 2003, in forum: Java
    Replies:
    6
    Views:
    4,440
    Todd Corley
    Dec 10, 2003
  5. AJ
    Replies:
    6
    Views:
    723
Loading...

Share This Page