I want to change both the background and foreground color of my button. I used setBackground and setForeground and setOpaque(true), and it worked for the foreground, but not for the background of the button. There is kind of like a black border around the button, but I want the button itself to be black. How do I fix it?
this.closeButton = new JButton ("Close");
this.closeButton.setBackground(Color.BLACK);
this.closeButton.setForeground(Color.PINK);
this.closeButton.setOpaque(true);