mardi 12 juillet 2016

There are some method to use toggle buttons without need to create a lot of conditions

I'm developing a program in java for admin orders in a restaurant. I have a screen like this. Frame for admin orders.

I want to select any button from left and any button from right and clic in button "Agregar" later. I'm thinking to do a method with a lot of conditions if and else if, for example.

if(buttonCombo1.isSelected() and buttonNumber1.isSelected()){
//Doing something
}else if(buttonCombo1.isSelected() and buttonNumber2.isSelected()){
//Doing something
}

I would have to do a lot of conditions, and I have no idea do otherwise. If you can help me to find another way for do It, I would be grateful.

Note: I apologize for my bad english. I'm learning yet. Thanks so much.

Aucun commentaire:

Enregistrer un commentaire