Cursor drawing is done automatically. You just need to create a cursor and
then use the setCursor method of Component. I have done something similar.
Here is a code snippet.

// creates an image of a circle with a plus
BufferedImage cursorImage = new
BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB);
Graphics g = cursorImage.getGraphics();
g.setColor(Color.white);
g.drawOval(6,6,20,20); // the circle
g.fillRect(9,15,14,3);  // h-line of plus
g.fillRect(15,9,3,14); // v-line of plus
g.setColor(Color.black);
g.drawOval(7,7,20,20); // the circle
g.drawLine(10,16,22,16);
g.drawLine(16,10,16,22);
addVertexCursor = toolkit.createCustomCursor(cursorImage, new Point(16,16),
"addVertexCursor");
...
setCursor(addVertexCursor);


At 02:33 PM 5/15/01 -0500, Ted Hill wrote:
>Hello,
>
>In an image processing application, I want to use a round 'cursor'  and to
>be able to tell whether certain image features (points) are inside or
>outside of the 'cursor.'
>
>I'm thinking of using Ellipse2D as the cursor:
>
>     1. each time the mouse moves, redraw the circle centered at the
> MouseEvent's x,y
>
>     2. use Shape.contains(Point2D pt) to see whether certain points are
> within the circle
>
>     3. create an invisible cursor using a transparent gif so all you see
> is the circle
>
>
>Does anyone have suggestions for better ways to do this?
>
>Thanks,
>
>Ted Hill

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to