ADDITIONAL SYSTEM INFORMATION :
Windows
A DESCRIPTION OF THE PROBLEM :
when we right click for context menu, the first option in the list is being highlighted without hovering the mouse. This happens only for the first time right click after the application is opened. This behavior is observed from javafx-9. Till javafx-8 its working fine.
REGRESSION : Last worked in version 8u212
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try with the below code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.TilePane;
import javafx.stage.Stage;
public class SampleContextMenu extends Application {
// labels
Label l;
public static void main(String args[]) {
// launch the application
launch(args);
}
// launch the application
public void start(Stage stage) {
// set title for the stage
stage.setTitle("creating contextMenu ");
// create a label
Label label1 = new Label("This is a ContextMenu example ");
// create a menu
ContextMenu contextMenu = new ContextMenu();
// create menuitems
MenuItem menuItem1 = new MenuItem("menu item 1");
MenuItem menuItem2 = new MenuItem("menu item 2");
MenuItem menuItem3 = new MenuItem("menu item 3");
// add menu items to menu
contextMenu.getItems().add(menuItem1);
contextMenu.getItems().add(menuItem2);
contextMenu.getItems().add(menuItem3);
// create a tilepane
TilePane tilePane = new TilePane(label1);
// setContextMenu to label
label1.setContextMenu(contextMenu);
// create a scene
Scene sc = new Scene(tilePane, 200, 200);
// set the scene
stage.setScene(sc);
stage.show();
}
}
FREQUENCY : always
Windows
A DESCRIPTION OF THE PROBLEM :
when we right click for context menu, the first option in the list is being highlighted without hovering the mouse. This happens only for the first time right click after the application is opened. This behavior is observed from javafx-9. Till javafx-8 its working fine.
REGRESSION : Last worked in version 8u212
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try with the below code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.TilePane;
import javafx.stage.Stage;
public class SampleContextMenu extends Application {
// labels
Label l;
public static void main(String args[]) {
// launch the application
launch(args);
}
// launch the application
public void start(Stage stage) {
// set title for the stage
stage.setTitle("creating contextMenu ");
// create a label
Label label1 = new Label("This is a ContextMenu example ");
// create a menu
ContextMenu contextMenu = new ContextMenu();
// create menuitems
MenuItem menuItem1 = new MenuItem("menu item 1");
MenuItem menuItem2 = new MenuItem("menu item 2");
MenuItem menuItem3 = new MenuItem("menu item 3");
// add menu items to menu
contextMenu.getItems().add(menuItem1);
contextMenu.getItems().add(menuItem2);
contextMenu.getItems().add(menuItem3);
// create a tilepane
TilePane tilePane = new TilePane(label1);
// setContextMenu to label
label1.setContextMenu(contextMenu);
// create a scene
Scene sc = new Scene(tilePane, 200, 200);
// set the scene
stage.setScene(sc);
stage.show();
}
}
FREQUENCY : always