An Exit Menu using EventHandler

exitMenuItem.setOnAction(new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent t)
{
Platform.exit();
}
});

The same using Lambda Expressions

exitMenuItem.setOnAction(ae -> Platform.exit());

One response to “JavaFX8 EventHandler Inner Class to Lambda”

  1. Ged Byrne Avatar
    Ged Byrne

    Nice, these new Lambdas are going to save so much typing.

Leave a comment

Skills421

Welcome to Skills421, our knowledge repository for all things tech in the 21st century

Let’s connect

Search