Hi, (sorry for X-Post, didn't see this NG before previous post)
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
Thomas Weidenfeller - 15 Feb 2005 14:45 GMT
> Is there another way to do this?
For horizontal and vertical lines only, draw a filled rectangle instead.
For lines with an arbitrary angle you will need to pick a line plotting
algorithm from some computer graphics textbook and implement it. Simply
drawing multiple neighboring lines usually doesn't work.
However, be prepared that your own line plotting can be much slower than
AWT's line plotting, because AWT uses the platform's graphics system
and hardware for drawing, while your own algorithm will have to do all
the hard work in software.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
Boudewijn Dijkstra - 15 Feb 2005 19:11 GMT
> Hi, (sorry for X-Post, didn't see this NG before previous post)
>
[quoted text clipped - 6 lines]
>
> Is there another way to do this?
Draw two lines.
Andrey Kuznetsov - 15 Feb 2005 22:37 GMT
> 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
[quoted text clipped - 5 lines]
>
> Is there another way to do this?
yes, see http://www.acme.com/java/software/Acme.Psg.html

Signature
Andrey Kuznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities