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
Xara
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
Korhan Ozturk
source
to share
You can look at setOpaque (true / false); Java contains information about the setOpaque method for the Component class.
+3
Rahul Borkar
source
to share
I want to give the buttons a transparent (glossy) look.
-
Transparent and here
-
Transparent with AlphaComposite
+3
mKorbel
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
Dev Service
source
to share