Article View: borland.public.jbuilder.java.api
Article #472Re: how to set the pen width when drawing on a graphics object?
From: John McGrath [TeamB]
Date: Fri, 29 Aug 2003 06:02
Date: Fri, 29 Aug 2003 06:02
16 lines
1426 bytes
1426 bytes
On 8/28/2003 at 9:59:24 AM, Mark wrote: > could anyone tell me how to set the pen width when drawing on a > graphics object? Assuming you are using Java 2, the Graphics object you receive in your paint() method will actually be a Graphics2D object, so to access the Graphics2D functionality, you will need to use a cast. You can set the pen width, along with the caps, dash attributes, etc., by seting the Stroke for the Graphics2D object. -- Regards, John McGrath [TeamB]
Technical Details
Message-ID:
<3f4eec81@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f4e0a44.24349671@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,fac958044e6bca54 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-08-28 23:08:02 PST From: "John McGrath [TeamB]" <ng-b@jpmcgrath.net> Subject: Re: how to set the pen width when drawing on a graphics object? Newsgroups: borland.public.jbuilder.java.api References: <3f4e0a44.24349671@newsgroups.borland.com> User-Agent: XanaNews/1.15.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 141.158.52.223 Message-ID: <3f4eec81@newsgroups.borland.com> Date: 28 Aug 2003 23:02:41 -0700 X-Trace: newsgroups.borland.com 1062136961 141.158.52.223 (28 Aug 2003 23:02:41 -0700) Lines: 16 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail