私はGUIを作るためにJava Netbeans GUI Builderを使用しています。私は透明(光沢)look.IもGUIへの素敵な外観を与えるJbuttons透過的な外観が必要
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
を使用していますボタンを与えたいと思うが、ボタンはまだ同じ退屈なボタンです。
ボタンを透明な外観にするにはどうすればいいですか?
私はGUIを作るためにJava Netbeans GUI Builderを使用しています。私は透明(光沢)look.IもGUIへの素敵な外観を与えるJbuttons透過的な外観が必要
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
を使用していますボタンを与えたいと思うが、ボタンはまだ同じ退屈なボタンです。
ボタンを透明な外観にするにはどうすればいいですか?
次のことを試してみてください。
button.setOpaque(false);
button.setContentAreaFilled(false); //to make the content area transparent
button.setBorderPainted(false); //to make the borders transparent
setOpaque(true/false); Javaには、ComponentクラスのsetOpaqueメソッドに関する情報があります。
I want to give the buttons a transparent (glossy) look.
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));