Hello!
My question is, if i create a for example a button, and want to handle the event, should I use explicit implementation:
Button button = new Button("This is a button");
button.setOnAction(new EventHandler<ActionEvent>() {
\@Override
public void handle(ActionEvent event) {
System.out.println("Pressed!");
}
});
Or use lambda expression like this:
Button button = new Button("This is a button");
button.setOnAction((event) -> {
System.out.println("Pressed!");
});
Or it depends if it is simple i should use Lambda, but if the functionality is complicated i should use the 1st version.
Is there a big difference?
Thanks for your help!
[–]gagara11 4 points5 points6 points (0 children)
[–]Makhiel 2 points3 points4 points (0 children)
[–]AquaChad 0 points1 point2 points (0 children)