Details
Description
This bug appears in the current early access release of JDK 8 (b126) and also in the previous one.
Minimal code to reproduce the issue:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.stage.Stage;
public class Test extends Application
{
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception
{
final ComboBox<String> cb = new ComboBox<String>();
cb.setEditable(true);
cb.setOnAction(new EventHandler<ActionEvent>()
{
int counter = 0;
@Override
public void handle(ActionEvent event)
{
System.out.println(counter++);
}
});
primaryStage.setScene(new Scene(cb));
primaryStage.show();
}
}
Run and type something text in the ComboBox text field, then press Enter. The OnAction event handler gets called twice (two numbers appear in the console).
Minimal code to reproduce the issue:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.stage.Stage;
public class Test extends Application
{
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception
{
final ComboBox<String> cb = new ComboBox<String>();
cb.setEditable(true);
cb.setOnAction(new EventHandler<ActionEvent>()
{
int counter = 0;
@Override
public void handle(ActionEvent event)
{
System.out.println(counter++);
}
});
primaryStage.setScene(new Scene(cb));
primaryStage.show();
}
}
Run and type something text in the ComboBox text field, then press Enter. The OnAction event handler gets called twice (two numbers appear in the console).