Article View: borland.public.jbuilder.java.swing
Article #9348Re: FlowLayout
From: Greg Hamer
Date: Mon, 17 Apr 2000 00:00
Date: Mon, 17 Apr 2000 00:00
39 lines
2232 bytes
2232 bytes
One trick is to place the buttons in a GridLayout that itself is inside a Container set to FlowLayout. Then all the buttons are the same size, but never bigger than the preferred size of the button with the longest text. When resizing, the buttons will not grow in size due to the FlowLayout. Erik Berry <eb@techie.ZZZcom> wrote in message news:MPG.135f2033c15ad4919896a9@newsgroups.borland.com... > Is there a way to convince FlowLayout or one of the other Java 1.1 (I > don't see an AWT newsgroup) LayoutManagers to do the following: > > ---------------------------------------- > Button1 | | > Button2 | | > Button3 | Panel | > Button4 | | > Button5 | | > Button6 | | > ---------------------------------------- > > In other words, I want several buttons centered in a left aligned > panel along the edge of a frame. It always stacks the buttons in a > horizontal line right now, like this: > > ---------------------------------------- > Button1 Button 2 Button3 etc | | > | | > | | > | Panel | > | | > | | > | | > ---------------------------------------- > > I'd rather not use any third-party LayoutManagers and GridLayout seems > to resize the button cells - spacing them as one expands the frame - > which isn't desired. > > Thanks, > Erik
Technical Details
Message-ID:
<8dfk6a$mkg8@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<MPG.135f2033c15ad4919896a9@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,65f027a49ffb0fdc X-Google-Attributes: gid111d45,public From: "Greg Hamer" <ghamer@corp.netzero.net> Subject: Re: FlowLayout Date: 2000/04/17 Message-ID: <8dfk6a$mkg8@bornews.borland.com> X-Deja-AN: 612337204 References: <MPG.135f2033c15ad4919896a9@newsgroups.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing