| 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
|
|
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
|
|
A JButton works a little different than other components. You need to use:
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
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
|
|
Darryl, my old keyboard broke and I got a new one a couple of days ago so I must be typing faster
|
 |
 |
|
|
subject: Transparent components
|
|
|