Article View: borland.public.jbuilder.java.swing
Article #9961Re: JButton borders
From: Paul Furbacher [TeamB]
Date: Sun, 19 Dec 1999 00:00
Date: Sun, 19 Dec 1999 00:00
26 lines
1637 bytes
1637 bytes
George Lefter wrote: > what i actually wanted to do is draw about five "concentric" rectangles > around the button. like this: > for(int i=10; i<60;i+=10) > g.drawRect( X0-i, Y0-i, width+2*i, height+2*i); > > but they get misplaced, so i broke down the problem to trying to draw a > rectangle that correctly surrounds my button. i just cant make the > rectangle have the same symmetry center as the button. Place a panel; create a border for it. Place a panel into that first panel; create a border for this new panel. Continue doing this until you have reached the number of required borders. If you are using JBuilder 3, creating a border is very easy using the property editor. If you are using JBuilder 2 (assuming you are using Swing), you have to manually write: Border border1 = BorderFactory.create...(...); Make sure the panels have the correct layout to center each nested panel, and finally, the button. Paul Furbacher (TeamB)
Technical Details
Message-ID:
<385D6B1B.AA12FF9E@bilbo.bio.purdue.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<385C6336.DFBE63B1@void.art.ro> <MPG.12c64d5810352fee989708@forums.borland.com> <385CE869.F7778E6D@void.art.ro>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c49df965457840ee X-Google-Attributes: gid111d45,public From: "Paul Furbacher [TeamB]" <pf@bilbo.bio.purdue.edu> Subject: Re: JButton borders Date: 1999/12/19 Message-ID: <385D6B1B.AA12FF9E@bilbo.bio.purdue.edu> X-Deja-AN: 562790245 Content-Transfer-Encoding: 7bit References: <385C6336.DFBE63B1@void.art.ro> <MPG.12c64d5810352fee989708@forums.borland.com> <385CE869.F7778E6D@void.art.ro> Content-Type: text/plain; charset=us-ascii Organization: Reverse Alchemy, Inc. Mime-Version: 1.0 Reply-To: pf@bilbo.bio.purdue.edu Newsgroups: borland.public.jbuilder.java.swing