Reputation: 507
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.
Upvotes: 0
Views: 43
Reputation: 34
I don't remember if you can group simple buttons. But you can define a click function in each button to change the value of button in a Bollean Array (with lenght equals amount of button.)
In this case, you will have acess a boolean value directly for a index.
Upvotes: 0