For my assignment I need a 2 dimensional array of JButtons in a grid JPanel in a JFrame. The JButtons must change color when clicked. I cannot get them to hold any color.
I implemented the solutions proposed in a previous thread and found that the work around only produced border color:
JButton button = new JButton("test");
button.setBackground(Color.RED);
button.setOpaque(true);
unpainting the border:
button.setBorderPainted(false);
simply causes the entire JFrame to be red.
This issue is only with MAC computers and not the intended problem of the assignment.
Any thoughts?