my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes Java Swing : how to make transparent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java Swing : how to make transparent" Watch "Java Swing : how to make transparent" New topic
Author

Java Swing : how to make transparent

J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
I wonder if there's a specific answer towards this question.
Since already almost 2 years I spent GUI programming in java.
I haven't notice about making the JFrame transparent as Adobe Air could.

Would anyone here know the answer? or at least could share a thought,
Since Oracle documentation suggest us to use JavaFX instead of Swing for achieving this purpose.

Uncle google seems giving me the same answers as oracle does.

I need a bit of advice. (^ ^'a.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43346
    
  32
Moving to our GUIs forum, where we usually discuss Swing matters.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43346
    
  32
I didn't find anything useful on the JFrame documentation with ctrl-f-opaque and ctrl-f-transparent.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3891
    
  18

I don't think this is possible as of yet. In Java 7 Swing provides transparency, I believe, but in Java 6 it does not.


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4950
    
    8

Since JDK 6u10, there's a hack that uses a Sun internal class com.sun.awt.AWTUtilities that will in all probability cease to exist in a future Java release that provides this feature as part of the public API.
http://java.sun.com/developer/technicalArticles/GUI/translucent_shaped_windows/


luck, db
There are no new questions, but there may be new answers.
J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
Stephan van Hulst wrote:I don't think this is possible as of yet. In Java 7 Swing provides transparency, I believe, but in Java 6 it does not.


what?? I should wait until July 28, 2011? Oh my goD!

I finally shocked, once read this


ahaha.... it's just a temporary cry...!!
hehehe

These example works for me...! tada....!

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java Swing : how to make transparent
 
jQuery in Action, 3rd edition