There should be a transparent view of Jbuttons

I am using Java Netbeans GUI Builder to create a GUI. I want to give buttons a transparent (glossy) look. I use

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

      

which also looks good in a GUI, but the buttons are still the same boring buttons.

So how do you give the buttons a transparent look?

+3
java swing transparency netbeans look-and-feel


source to share


4 answers


Try the following:



button.setOpaque(false);
button.setContentAreaFilled(false); //to make the content area transparent
button.setBorderPainted(false); //to make the borders transparent

      

+5


source to share


You can look at setOpaque (true / false); Java contains information about the setOpaque method for the Component class.



+3


source to share


I want to give the buttons a transparent (glossy) look.

      

  • Transparent and here

  • Transparent with AlphaComposite

+3


source to share


this.btnOptions.setFont(new Font("Forte", Font.PLAIN, 33)); 
this.btnOptions.setForeground(Color.YELLOW);
this.btnOptions.setOpaque(false);
this.btnOptions.setContentAreaFilled(false);
this.btnOptions.setBorderPainted(false);
this.btnOptions.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

      

0


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics