| Article: |
Hacking Swing: Translucent Windows | |
| Subject: | Java 5 Problems | |
| Date: | 2005-12-01 11:15:32 | |
| From: | jamescook2 | |
| It seems that in Java 5 (on Windows) the frame.hide() and frame.show() methods cause a focus lost/gained event to fire creating an infinite loop of flicker. | ||
Showing messages 1 through 2 of 2.
-
Java 5 Problems
2005-12-01 12:07:34 jamescook2 [View]
-
Java 5 Problems
2010-08-08 08:41:41 benoit.rolland.free.fr [View]
To blur the background may be interesting,
But if you don't want to,
here is the way:
//Image img = _blurOp.filter(buf, null);
Image img = buf;
g2.drawImage(img, 0, 0, null);
//g2.setColor(new Color(255, 255, 255, 192));
g2.setColor(new Color(255, 255, 255, 0));



In addition, this code causes the background area to blur slightly and fade towards white a bit. It's like the effect that you might see in Window's Vista, just not as nice/native. I also get rid of the unnecessary create of Date objects that are in the original code base. Less objects created the better.