Minimum form size with grid bag layout

Discussion in 'Java' started by Marcin Rze¼nicki, Oct 25, 2009.

  1. Hi all,
    Is there a way to specify minimum form size using grid bag? I set
    minimum sizes on components I don't want to be resized below certain
    size, but it does not seem to respect it whatsoever. I am not posting
    code 'cause it is generated by Net Beans.
     
    Marcin Rze¼nicki, Oct 25, 2009
    #1
    1. Advertising

  2. Marcin Rzeźnicki wrote:
    > Hi all,
    > Is there a way to specify minimum form size using grid bag? I set
    > minimum sizes on components I don't want to be resized below certain
    > size, but it does not seem to respect it whatsoever. I am not posting
    > code 'cause it is generated by Net Beans.



    Play with my GridBagLayout tester program,

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

    Use the sample layout #3 and right click on a component and set the
    minimum size, then grab the lower right corner and squeeze the
    components. You can get a good idea of how GBL works with minimum sizes
    playing with it.

    --

    Knute Johnson
    email s/nospam/knute2009/

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

  3. On 25 Paź, 05:13, Knute Johnson <>
    wrote:
    > Marcin Rzeźnicki wrote:
    > > Hi all,
    > > Is there a way to specify minimum form size using grid bag? I set
    > > minimum sizes on components I don't want to be resized below certain
    > > size, but it does not seem to respect it whatsoever. I am not posting
    > > code 'cause it is generated by Net Beans.

    >
    > Play with my GridBagLayout tester program,
    >
    > http://rabbitbrush.frazmtn.com/gridbagtester.html


    Thanks
     
    Marcin Rzeźnicki, Oct 25, 2009
    #3
  4. On 25 Pa¼, 12:50, Marcin Rze¼nicki <> wrote:
    > On 25 Pa¼, 05:13, Knute Johnson <>
    > wrote:
    >
    > > Marcin Rze¼nicki wrote:
    > > > Hi all,
    > > > Is there a way to specify minimum form size using grid bag? I set
    > > > minimum sizes on components I don't want to be resized below certain
    > > > size, but it does not seem to respect it whatsoever. I am not posting
    > > > code 'cause it is generated by Net Beans.

    >
    > > Play with my GridBagLayout tester program,

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

    >
    > Thanks


    Ok, I played with your app a little, but I must confess that I am none
    the wiser. The re-sizable panel which you provided can be shrunk to
    any size despite playing with min sizes of components belonging to it
    and its own settings.
     
    Marcin Rze¼nicki, Oct 25, 2009
    #4
  5. Marcin Rze¼nicki wrote:
    > On 25 Pa¼, 12:50, Marcin Rze¼nicki <> wrote:
    >> On 25 Pa¼, 05:13, Knute Johnson <>
    >> wrote:
    >>
    >>> Marcin Rze¼nicki wrote:
    >>>> Hi all,
    >>>> Is there a way to specify minimum form size using grid bag? I set
    >>>> minimum sizes on components I don't want to be resized below certain
    >>>> size, but it does not seem to respect it whatsoever. I am not posting
    >>>> code 'cause it is generated by Net Beans.
    >>> Play with my GridBagLayout tester program,
    >>> http://rabbitbrush.frazmtn.com/gridbagtester.html

    >> Thanks

    >
    > Ok, I played with your app a little, but I must confess that I am none
    > the wiser. The re-sizable panel which you provided can be shrunk to
    > any size despite playing with min sizes of components belonging to it
    > and its own settings.


    Yes you can always make the container smaller than the components it
    holds. If you call pack() however it will shrink the components to
    their preferred sizes. If you further shrink the container, the
    components will shrink immediately to their minimum sizes.

    If you wish to control the minimum size of a container with GBL, one way
    is to set the preferred size of the components and call pack().

    --

    Knute Johnson
    email s/nospam/knute2009/

    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    Knute Johnson, Oct 25, 2009
    #5
  6. On 25 Pa¼, 18:10, Knute Johnson <>
    wrote:
    > Marcin Rze 1/4 nicki wrote:
    > > On 25 Pa 1/4, 12:50, Marcin Rze 1/4 nicki <> wrote:
    > >> On 25 Pa 1/4, 05:13, Knute Johnson <>
    > >> wrote:

    >
    > >>> Marcin Rze 1/4 nicki wrote:
    > >>>> Hi all,
    > >>>> Is there a way to specify minimum form size using grid bag? I set
    > >>>> minimum sizes on components I don't want to be resized below certain
    > >>>> size, but it does not seem to respect it whatsoever. I am not posting
    > >>>> code 'cause it is generated by Net Beans.
    > >>> Play with my GridBagLayout tester program,
    > >>>http://rabbitbrush.frazmtn.com/gridbagtester.html
    > >> Thanks

    >
    > > Ok, I played with your app a little, but I must confess that I am none
    > > the wiser. The re-sizable panel which you provided can be shrunk to
    > > any size despite playing with min sizes of components belonging to it
    > > and its own settings.

    >
    > Yes you can always make the container smaller than the components it
    > holds. If you call pack() however it will shrink the components to
    > their preferred sizes. If you further shrink the container, the
    > components will shrink immediately to their minimum sizes.
    >
    > If you wish to control the minimum size of a container with GBL, one way
    > is to set the preferred size of the components and call pack().
    >


    Works like a charm, thanks.
     
    Marcin Rze¼nicki, Oct 26, 2009
    #6
  7. Marcin Rze¼nicki wrote:
    > On 25 Pa¼, 18:10, Knute Johnson <>
    > wrote:
    >> Marcin Rze 1/4 nicki wrote:
    >>> On 25 Pa 1/4, 12:50, Marcin Rze 1/4 nicki <> wrote:
    >>>> On 25 Pa 1/4, 05:13, Knute Johnson <>
    >>>> wrote:
    >>>>> Marcin Rze 1/4 nicki wrote:
    >>>>>> Hi all,
    >>>>>> Is there a way to specify minimum form size using grid bag? I set
    >>>>>> minimum sizes on components I don't want to be resized below certain
    >>>>>> size, but it does not seem to respect it whatsoever. I am not posting
    >>>>>> code 'cause it is generated by Net Beans.
    >>>>> Play with my GridBagLayout tester program,
    >>>>> http://rabbitbrush.frazmtn.com/gridbagtester.html
    >>>> Thanks
    >>> Ok, I played with your app a little, but I must confess that I am none
    >>> the wiser. The re-sizable panel which you provided can be shrunk to
    >>> any size despite playing with min sizes of components belonging to it
    >>> and its own settings.

    >> Yes you can always make the container smaller than the components it
    >> holds. If you call pack() however it will shrink the components to
    >> their preferred sizes. If you further shrink the container, the
    >> components will shrink immediately to their minimum sizes.
    >>
    >> If you wish to control the minimum size of a container with GBL, one way
    >> is to set the preferred size of the components and call pack().
    >>

    >
    > Works like a charm, thanks.
    >


    You're welcome.

    --

    Knute Johnson
    email s/nospam/knute2009/

    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    Knute Johnson, Oct 26, 2009
    #7
    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,221
    Rick Spiewak
    Aug 26, 2003
  2. Replies:
    1
    Views:
    649
    John Timney \(MVP\)
    Jun 19, 2006
  3. gk

    grid bag layout problem

    gk, Sep 5, 2006, in forum: Java
    Replies:
    13
    Views:
    817
  4. T.A.
    Replies:
    7
    Views:
    515
    Daniel T.
    Dec 3, 2006
  5. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,743
    Michael Jung
    May 25, 2008
Loading...

Share This Page