So i have a GUI program called Safe25. Basically, if you press the buttons in the right order which is \"15032018\" the program closes itself. If you input a correct number, let
have you red the javadoc for JButton?
edit:
Sorry i looked over your code to quickly. What your doing right now is setting the background color of every component in the current container. While your buttons array is global you could simply loop trough that collection again to get the correct components "the buttons" and setting the background color like so:
for (JButton b : buttons) // line 75, i want this one
b.setBackground(col); // to change the buttons backgroundcolor
repaint(); // but it changes the frames backgroundcolor instead