dragging a transparent JFrame  
Author Message
eishak





PostPosted: 2005-10-12 0:19:00 Top

java-programmer, dragging a transparent JFrame I'm able to get a transparent JFrame using java 1.4+ on Mac OS X. I
simply set the JFrame's background to a transparent color. However,
with a transparent color (any alpha component less than 255), when I
drag within the JFrame (not the titlebar), it drags the entire JFrame
with it. This makes for unexpected results when dragging an object
within the JFrame that also drags the entire JFrame.

Any ideas?

 
Andrew Thompson





PostPosted: 2005-10-12 9:56:00 Top

java-programmer >> dragging a transparent JFrame email***@***.com wrote:

> I'm able to get a transparent JFrame using java 1.4+ on Mac OS X. I
> simply set the JFrame's background to a transparent color.

Wow! Do you mean you can see straight through to the desktop?!?
Can you provide a screenshot of that? I imagine it is a bug.

> Any ideas?

Give up on 'exploiting bugs'?
 
Thomas Weidenfeller





PostPosted: 2005-10-12 15:15:00 Top

java-programmer >> dragging a transparent JFrame Andrew Thompson wrote:
> email***@***.com wrote:
>
>> I'm able to get a transparent JFrame using java 1.4+ on Mac OS X. I
>> simply set the JFrame's background to a transparent color.
>
>
> Wow! Do you mean you can see straight through to the desktop?!?
> Can you provide a screenshot of that? I imagine it is a bug.

Yep, that is possible. The VM even observes the alpha component, so you
can have top-level windows with a half transparent view through to the
desktop. The 'trick' was revealed some time ago. I even added it to the
FAQ - only that I haven't published that version of the FAQ yet ... :-)

> Give up on 'exploiting bugs'?

I think Apple sells it as a feature. And when you think of it, all Apple
does is implementing the API spec. word for word, while Sun doesn't
manage to do this in their VM. IMHO the bug is not in the transparency,
but with the DnD behavior.

To the OP: Consider contacting Apple and file a bug report. Maybe they
even already know about the bug and have a fix for it.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/