Re: Graphics2D problem



> i describe a drawArrow method below, which takes 5 parameters : a graphics
> object g and the coordinates of 2 points.
> What i want to achieve is to draw a dotted line
> whenever i pass a Graphics2D object to drawArrow method and a solid line
> whenever
> i pass a Graphics object.The problem is that even if i pass a
> graphics object to drawArrow method i get a dotted line.
> Why does this happen?

although variable g is declared as as Graphics (for backwards
compatibility), it points to Graphics2D object
Probably you have to run your app on java 1.1 to get solid line painted,
however it wouldn't compile on java 1.1 and compiled on java2 it wouldn't
run on 1.1...
You could solve this problem Reflection.

HTH
--
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities


.