I have an issue, let's say I have a Javafx UI (no FXML), in an MVC structure, I've been assigned a view where the user can choose a quantity of X (increased by the click of a button controlled in the view already) to be upgrated after clicking a Button PowerUp.
BUT I don't have just an item type X, I have multiple (2 or more).
How do I override the method everytime I choose a different item type? This is the method I came up with, It's just part of the controller class which does only this
buttonB.setOnAction(new EventHandler <ActionEvent>(){
@ Override
public void handle(ActionEvent actionEvent) {
//commands bla bla bla;
}
}
It can only be one item type at a time, I cannot power up 2 types of items at the same time.
I should create multiple eventhandlers like this with a different ? if so, what should I put instead of the ActionEvent? Recalling item from the model class?
I have found a similar question Here
Thanks and kind regards.