The Source for Java Technology Collaboration

Home » java.net Forums » Java Desktop Technologies » SwingLabs

Thread: Outlook style popup that fades slowly

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 8 - Last Post: Apr 30, 2007 12:30 AM by: chris_e_brown
tvmohan

Posts: 2
Outlook style popup that fades slowly
Posted: Apr 26, 2007 8:56 PM
 
  Click to reply to this thread Reply

How can we build a outlook style window that has fading effects? Every time a new email arrives, it pops up and slowly fades away. I need build something similar. Can we really make a JWindow translusent by setting the alpha somehow? I looked at the SwingX components, I could not find any that works this way. SwingX lets me set the alpha on a JXPanel but not on a window. So, I was wondering if anybody is working on this kind of window.

rasto1968

Posts: 221
Re: Outlook style popup that fades slowly
Posted: Apr 26, 2007 11:57 PM   in response to: tvmohan
 
  Click to reply to this thread Reply

Have a look at the following:

http://www.curious-creature.org/2007/04/10/translucent-swing-windows-on-mac-os-x/

Although this is OSX specific, Romain mentions another project (https://jna.dev.java.net/) which has has an example of setting up transparent windows on other platforms.

Rob

Peter Weishapl
Re: Outlook style popup that fades slowly
Posted: Apr 27, 2007 12:14 AM   in response to: tvmohan
  Click to reply to this thread Reply

I think Jide has an outlook style popup window, but I don't know if
it fades away.
Anyway, you should have a look at: https://jide-oss.dev.java.net/

-peter

On 27.04.2007, at 05:56, jdnc-interest@javadesktop.org wrote:

> How can we build a outlook style window that has fading effects?
> Every time a new email arrives, it pops up and slowly fades away. I
> need build something similar. Can we really make a JWindow
> translusent by setting the alpha somehow? I looked at the SwingX
> components, I could not find any that works this way. SwingX lets
> me set the alpha on a JXPanel but not on a window. So, I was
> wondering if anybody is working on this kind of window.
> [Message sent by forum member 'tvmohan' (tvmohan)]
>
> http://forums.java.net/jive/thread.jspa?messageID=214568
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net


Bill Snyder
Re: Outlook style popup that fades slowly
Posted: Apr 27, 2007 6:44 AM   in response to: Peter Weishapl
  Click to reply to this thread Reply

Also take a look at the jtoaster project

On 4/27/07, Peter Weishapl <petw@gmx.net> wrote:
>
> I think Jide has an outlook style popup window, but I don't know if
> it fades away.
> Anyway, you should have a look at: https://jide-oss.dev.java.net/
>
> -peter
>
> On 27.04.2007, at 05:56, jdnc-interest@javadesktop.org wrote:
>
> > How can we build a outlook style window that has fading effects?
> > Every time a new email arrives, it pops up and slowly fades away. I
> > need build something similar. Can we really make a JWindow
> > translusent by setting the alpha somehow? I looked at the SwingX
> > components, I could not find any that works this way. SwingX lets
> > me set the alpha on a JXPanel but not on a window. So, I was
> > wondering if anybody is working on this kind of window.
> > [Message sent by forum member 'tvmohan' (tvmohan)]
> >
> > http://forums.java.net/jive/thread.jspa?messageID=214568
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> > For additional commands, e-mail: jdnc-help@jdnc.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> For additional commands, e-mail: jdnc-help@jdnc.dev.java.net
>
>
[att1.html]


gfx

Posts: 158
Re: Outlook style popup that fades slowly
Posted: Apr 27, 2007 9:31 AM   in response to: tvmohan
 
  Click to reply to this thread Reply

JNA is a very good start. At the Extreme GUI Makeover session at JavaOne, I'll show a cool effect with fading windows. Hopefully we'll release the code very soon ^^

chris_e_brown

Posts: 72
Re: Outlook style popup that fades slowly
Posted: Apr 27, 2007 1:49 PM   in response to: tvmohan
 
  Click to reply to this thread Reply

JIDE does indeed have exactly what you're looking for:
http://www.jidesoft.com/products/component.htm

I've used it (and the other components) and they're great.

- Chris

tvmohan

Posts: 2
Re: Outlook style popup that fades slowly
Posted: Apr 29, 2007 2:11 AM   in response to: chris_e_brown
 
  Click to reply to this thread Reply

Thankyou every one. I appreciate it. I will start looking into JNA. It looks very exciting.

sinewalker

Posts: 1
Re: Outlook style popup that fades slowly
Posted: Apr 29, 2007 8:50 PM   in response to: tvmohan
 
  Click to reply to this thread Reply

In case JNA turns out not to meet your needs (?) here's the basic algorithm:

1. Grab a snapshot of the screen where the pop-up is to appear, place it in a buffered image
2. Draw your pop-up to another buffered image
3. Draw your pop-up to the screen
4. To fade: blend the pop-up image with the snapshot image you first took, with the snapshot nearly 100% transparent, then repaint the result to the pop-up screen area (use double-buffering to reduce flicker if you want). Then sleep for a few milliseconds and repeat, until the snapshot is 0% transparent (100% opaque).

chris_e_brown

Posts: 72
Re: Outlook style popup that fades slowly
Posted: Apr 30, 2007 12:30 AM   in response to: sinewalker
 
  Click to reply to this thread Reply

Don't use Thread.sleep() as you'll block the event-dispatching thread. Use a Swing timer or look at https://timingframework.dev.java.net/




 XML java.net RSS