By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

Setting Background partly transparent

P: n/a
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
mouseMotionListener 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.

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.