🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages Started by Mark Thu, 28 Aug 2003 13:59
how to set the pen width when drawing on a graphics object?
#471
Author: Mark
Date: Thu, 28 Aug 2003 13:59
12 lines
1090 bytes
Hi,

could anyone tell me how to set the pen width when drawing on a
graphics object? 

I just cant see it! (ah in delphi / windows it is so easy...)

Mark



Mark
Re: how to set the pen width when drawing on a graphics object?
#472
Author: John McGrath [TeamB]
Date: Fri, 29 Aug 2003 06:02
16 lines
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]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads