Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > draw thick line without using Graphics2D

Reply
Thread Tools

draw thick line without using Graphics2D

 
 
SPG
Guest
Posts: n/a
 
      02-15-2005
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


 
Reply With Quote
 
 
 
 
Matt Humphrey
Guest
Posts: n/a
 
      02-15-2005

"SPG" <(E-Mail Removed)> wrote in message
news:9ZmQd.15131$(E-Mail Removed). uk...
> 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 http://www.velocityreviews.com/forums/(E-Mail Removed) http://www.iviz.com/


 
Reply With Quote
 
 
 
 
SPG
Guest
Posts: n/a
 
      02-15-2005
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

"Matt Humphrey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "SPG" <(E-Mail Removed)> wrote in message
> news:9ZmQd.15131$(E-Mail Removed). uk...
>> 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 Removed) http://www.iviz.com/
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Line drawing with Bresenham more than one pixel thick Dann Corbit C Programming 2 04-12-2010 04:41 PM
Re: Line drawing with Bresenham more than one pixel thick Ian Collins C Programming 4 04-09-2010 08:31 AM
How to draw vector graphics on Graphics2D wookashs Java 1 05-04-2008 09:03 PM
How to imitate a line 1 pixel thick? marss HTML 22 07-14-2007 10:56 PM
Vertical draw text not working in Graphics2D? Kevin Java 3 01-05-2005 05:38 PM



Advertisments