I'm trying to creat simple seating for movie
I have the seats as buttons when the user click btnOne then the background change to red if the user click the button again it will chnage to gray
I've managed to change the color to red when it clicked using actionpreformed , but how can I change it to gray when it clicked again
if( btnOne.isSelected() == false){
btnOne.setBackground(Color.RED);
res = true;
}
I've also tried this but it doesnt' work
if( btnOne.isSelected() == false){
btnOne.setBackground(Color.RED);
btnOne.setSelected(true);
}
if(btnOne.isSelected() == true){
btnOne.setBackground(Color.black);
btnOne.setSelected(false);
}