TRANSPARENT WINDOWS OR JFRAMEs
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rodolfo_Gomez
Posted On:   Friday, June 27, 2003 05:57 AM

IS IT POSSIBLE TO display a JFrame with a transparent background? If the answer is yes, how to do it?

The general idea is to write a message in the Window Screen of a PC running Windows 95/98/NT/XP , but you must continue seeing what is in the background.

Re: TRANSPARENT WINDOWS OR JFRAMEs

Posted By:   Bahman_Barzideh  
Posted On:   Friday, June 27, 2003 06:40 AM

I don't believe you can do this with the current version of Java.
Currently you can make any JComponent transparent (see-through)
by calling setOpaque (false) on it (you can also make them semi-transparent by setting an alpha value in their background color). This is not the case
with JFrame, JWindow or JDialog.



To be sure You can see evidence of this in the documentation for
JFrame. The following is from the description for setContentPane () in JFrame's documentation (JDK 1.4.1):



"Swing's painting architecture requires an opaque JComponent in the containment hiearchy. This is typically provided by the content pane. If you replace ..."
About | Sitemap | Contact