aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Transparent components Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Transparent components" Watch "Transparent components" New topic
Author

Transparent components

Ivan Kesic
Ranch Hand

Joined: Feb 05, 2009
Posts: 61
Hello

i have JPanel with background image. So, i need to put my buttons on panel on the same spot as they are on the background picture, and then make them transparent so it looks like you click on picture and not on a real button. But, if i set opaque on button (btn1.setOpaque(false);) it only shows panel's original color, grey, and not the picture that is drawn on him. How can i fix this?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3053
    
    1

Hi Ivan, take a look at this thread:

http://www.coderanch.com/t/540606/GUI/java/JPanel-Transparent-does-not-work
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1790
    
    2
A JButton works a little different than other components. You need to use:

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4167
    
    3



edit Today's not a good day. No responses for nearly 3 hours and this has to happen to me

Hi Rob!

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

Joined: Jun 13, 2009
Posts: 1790
    
    2
Darryl, my old keyboard broke and I got a new one a couple of days ago so I must be typing faster
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transparent components
 
Similar Threads
Partially transparent backgrounds ?
Images on top of each other
SWT Composite setBackgroundImage() doesn't support transparency?
submit button problem in IE
Transparancy