Easy layout question

Discussion in 'Java' started by Si, Apr 7, 2004.

  1. Si

    Si Guest

    How do I have the main Container in my Frame, so that it contains two "rows"
    of panels - the only difference between the two being that the top on is
    about 10% of the height (or, say, 50 pixels)?

    I currently have a GridLayout(2,1), but it displays both "rows" them with
    equal heights...
     
    Si, Apr 7, 2004
    #1
    1. Advertising

  2. Si

    Bjorn Abelli Guest

    "Si" wrote...

    > How do I have the main Container in my Frame, so that
    > it contains two "rows" of panels - the only difference
    > between the two being that the top on is
    > about 10% of the height (or, say, 50 pixels)?


    There are a lot of possibilities. Beside the use of the ordinary
    LayoutManagers, you can even define your own.

    However, 10 % or 50 pixels are two different paradigms in the underlying
    assumptions on how the LayoutManagers work.

    The use of exact pixel sizes was more or less abandoned for the use of
    relative sizes. This is to some degree based on the premise that you would
    probably prefer the look of the layout to adapt more to the actual
    platform...

    To make a long story short:

    One suggestion could be to use a BorderLayout. Put the upper panel into the
    NORTH place, and the lower one in the CENTER.

    // Bjorn A
     
    Bjorn Abelli, Apr 7, 2004
    #2
    1. Advertising

  3. Si wrote:

    > How do I have the main Container in my Frame, so that it contains two "rows"
    > of panels - the only difference between the two being that the top on is
    > about 10% of the height (or, say, 50 pixels)?


    You may consider using the FormLayout and the Forms layout system.
    See http://www.jgoodies.com/freeware/forms/

    Karsten
     
    Karsten Lentzsch, Apr 8, 2004
    #3
    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. Rick Spiewak
    Replies:
    3
    Views:
    3,167
    Rick Spiewak
    Aug 26, 2003
  2. Eric
    Replies:
    4
    Views:
    741
    clintonG
    Dec 24, 2004
  3. AJ

    Easy Layout Question

    AJ, Dec 29, 2003, in forum: Java
    Replies:
    23
    Views:
    883
  4. Replies:
    1
    Views:
    406
    Toby Inkster
    Feb 10, 2006
  5. Replies:
    1
    Views:
    598
    John Timney \(MVP\)
    Jun 19, 2006
Loading...

Share This Page