how do i change the opacity of a jbutton

Solutions on MaxInterview for how do i change the opacity of a jbutton by the best coders in the world

showing results for - "how do i change the opacity of a jbutton"
Kevin
24 Jun 2016
1private float opacity;
2//......
3public setOpacity(float opacity) {
4    this.opacity = opacity;
5}
6
7public void getOpacity(){
8    return this.opacity
9}
Matthew
11 Jul 2018
1MyJButton myJbtn = new MyJButton();
2myJbtn.setOpacity(0.5);
3myJbtn.repaint();