It would be nice to have support for true Window transparency, but in
the meantime, the hack you suggested was exactly what I had in mind for
my fall-back technique.

Great minds think alike. Or, at least they all read the same newsgroups.

;)

Rob

On May 29, 2004, at 8:25 AM, Chet Haase wrote:

Rob and Mark,

The solution below will work for lightweight components, but not for
toplevel windows (which is what I assume Rob asking about).

We do not yet (as of 1.5) have the capability of
transparent/translucent
toplevel Windows.  Yes, the capability exists on some platforms.  One
of
the tricks in making this work in the library is handling it in a
cross-platform-friendly way.

Anyway, it's one of the things we are hoping to implement
in the next release.

(There are always hack workarounds like using an undecorated frame,
capturing the background of the desktop with Robot, and then
painting the background on top of the frame, but you're probably
looking
for something a bit more standard and dependable...)

Chet.


----- Original Message ----- From: Mark McKay <[EMAIL PROTECTED]> Date: Saturday, May 29, 2004 7:30 am Subject: [JAVA2D] transparent windows yet?

Call setOpaque(false); on your window.  Then, when you repaint it, do
something like:

public void paintComponent(Graphics g)
{
   Composite oldComposite = g.setComposite(AlphaComposite.Clear);
  g.fill(getBounds());
  g.setComposite(oldComposite);

  //Rendering code
}

Mark McKay


Rob Ross wrote:

I'm in the middle of a project where being able to make a window's
background
 translucent/semi-transparent would be a very very cool thing
to have.

Is this possible yet with 1.4? If not, how about 1.5?

Is this feature really that  hard to implement?

I'm asking honestly, I don't know what's required in the JVM to
make> this happen. But since both OS X and WindowsXP seem to do
this all the
time now, I have to assume most of the "hard" code already has  been
written in those platform's native libraries.



Rob Ross
Senior Software Engineer
E! Networks
[EMAIL PROTECTED]

===========================================================================
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