File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Help! Having trouble animating translucent window. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help! Having trouble animating translucent window." Watch "Help! Having trouble animating translucent window." New topic
Author

Help! Having trouble animating translucent window.

Dan Bizman
Ranch Hand

Joined: Feb 25, 2003
Posts: 387
What I'm trying to do is have a small window that is over a Frame and is comes out of the right side of the frame and appears bit-by-bit as it moves to the left side. It will be a translucent (NOT transparent) window, so I'm using AlphaComposite (with a float of 0.2f). The problem is that when I draw the background and then each time draw a few more pixels of it as translucent (to simulate the window moving over it), the translucence gets less and less so until it's transparent! I don't know how to fix this.

Basically right now I'm using a Timer and doing something like:



But this doesn't work!
[ January 28, 2005: Message edited by: Dan Bizman ]
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535

[ January 28, 2005: Message edited by: Craig Wood ]
Dan Bizman
Ranch Hand

Joined: Feb 25, 2003
Posts: 387
Thanks! That's actually quite close to what I ended up doing, but definitely much nicer code. Thanks again!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help! Having trouble animating translucent window.
 
Similar Threads
First off, an apology to those that moderate this forum
Image lost behind buttons
Making translucent images
How to hide all controls except one using div ?
Drawing a Transparent PNG