I am using netbeans to create a desktop application, and I am trying to change the background color of a JButton, btn1 using the code
btn1.setBackground(Color.Red)
But this does not work. Instead of changing the fill color of the button, only the border color is changed. How can I change the background fill?
Thanks