Hello,
I have some trouble with designing my GUI for an application.
I need to draw a certain shape (circle, rectangle) on a JPanel which follows
the mouse move on that JPanel.
Well the problem is the background. I should be transparent and only showing
the current shape.
I used the paintComponent( ) method to draw the shape and a
mouseMotionList ener for realising the move- effects.
On runtime, it paints many shapes (one for each mouse move) but it should be
just one.
Clearing the Graphics2D Object with the clear() method makes the component
be painted in the default background color.
Is there a solution for making components partly transparent?
Is there another simple way of realising this?
Thanks.
I have some trouble with designing my GUI for an application.
I need to draw a certain shape (circle, rectangle) on a JPanel which follows
the mouse move on that JPanel.
Well the problem is the background. I should be transparent and only showing
the current shape.
I used the paintComponent( ) method to draw the shape and a
mouseMotionList ener for realising the move- effects.
On runtime, it paints many shapes (one for each mouse move) but it should be
just one.
Clearing the Graphics2D Object with the clear() method makes the component
be painted in the default background color.
Is there a solution for making components partly transparent?
Is there another simple way of realising this?
Thanks.