So I want a JButton to alternate between 2 colors when clicked. So say it is originally yellow. When it is clicked it changes to red and when it is clicked again, it changes back to yellow and then next click = red and so on.
Please fill in the code for me in between this block: Assume the JButton variable is btn and use Color.RED and Color.YELLOW
btnSearch.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
...
}
}