draw thick line without using Graphics2D

S

SPG

Hi,

We have an applet that MUST support jvm 1.1 (MS JVM also).
I want to plot some lines, and the selected line needs to be two points
thick.

Simple to do with Graphics2D (setStroke(new BasicStroke(2)), but this is not
supported with the older JVMs.

Is there another way to do this?

Steve
 
M

Matt Humphrey

SPG said:
Hi,

We have an applet that MUST support jvm 1.1 (MS JVM also).
I want to plot some lines, and the selected line needs to be two points
thick.

Simple to do with Graphics2D (setStroke(new BasicStroke(2)), but this is not
supported with the older JVMs.

Is there another way to do this?

If the line is horizontal or vertical, fill a rectangle. If the line must
be arbitrary, draw 4 parallel lines by offsetting the endpoints by (0,0),
(0,1), (1,0), (1,1). (You can do this with 2 lines, but you have to change
the offsets for different angles and it may still leave gaps.)

Cheers,
Matt Humphrey (e-mail address removed) http://www.iviz.com/
 
S

SPG

Hi,

Thanks.. Unfortunately the lines are not horizontal, but I cna apply that
method anyhow as I know the endpoints so I can just add one and redraw..

Will have a go anyway..

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top