Does anybody know how to set the background color temporarily on a Button.
buttons[randomI][randomJ].setBackgroundColor(Color.rgb(155, 17, 30));
Here is what I have but I only want to set the background color of this for a certain period of time. I understand that a way to go about this is to remove the background color after a certain period of time but I don't know how to remove background color. I referenced: How to get JButton default background color? and the solutions did not work for me.
In the top answer:
btn.setBackground(new JButton().getBackground());
JButton does not exist for me and using new Button().getBackground says that it can not resolve constructor. So is there any way to temporarily set the background color?