FULL PRODUCT VERSION :
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.14393]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Dual-Monitor setup with 4K resolution on both monitors.
Primary monitor is an external screen (Windows rescaling factor = 150%)
Secondary monitor is a laptop screen (Windows rescaling factor = 200%)
A DESCRIPTION OF THE PROBLEM :
When I run any JavaFX Application with a MenuBar, the menu ceases to work as soon as I move the application from my primary to my secondary monitor. I am still able to click on the Menus in the MenuBar, but as soon as I release my mouse button the popup disappears. This makes it impossible to click on any of the items in the menu bar. Accessing the items via keyboard still works as expected.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Launch any JavaFX Application with a MenuBar on your primary screen
2. Move the Application to your secondary screen
3. Attempt to click on one of the MenuItems
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The MenuItem's action is triggered
ACTUAL -
The MenuBar's popup is only shown for as long as you hold the mouse button and you cannot trigger any of the actions. In some cases, the popup also appears on the wrong location on the screen...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package sample;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TextArea;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
TextArea console = new TextArea();
MenuBar menuBar = createMenuBar(console);
Parent root = new VBox(menuBar, console);
primaryStage.setTitle("Excelsior JET GUI Test");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.show();
}
private MenuBar createMenuBar(final TextArea console) {
MenuItem printHelloWorld = new MenuItem("_Print Hello World");
printHelloWorld.setOnAction(e -> console.appendText("Hello World\n"));
MenuItem clearConsole = new MenuItem("_Clear Console");
clearConsole.setOnAction(e -> console.clear());
Menu fileMenu = new Menu("_File");
fileMenu.getItems().add(printHelloWorld);
fileMenu.getItems().add(clearConsole);
return new MenuBar(fileMenu);
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.14393]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Dual-Monitor setup with 4K resolution on both monitors.
Primary monitor is an external screen (Windows rescaling factor = 150%)
Secondary monitor is a laptop screen (Windows rescaling factor = 200%)
A DESCRIPTION OF THE PROBLEM :
When I run any JavaFX Application with a MenuBar, the menu ceases to work as soon as I move the application from my primary to my secondary monitor. I am still able to click on the Menus in the MenuBar, but as soon as I release my mouse button the popup disappears. This makes it impossible to click on any of the items in the menu bar. Accessing the items via keyboard still works as expected.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Launch any JavaFX Application with a MenuBar on your primary screen
2. Move the Application to your secondary screen
3. Attempt to click on one of the MenuItems
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The MenuItem's action is triggered
ACTUAL -
The MenuBar's popup is only shown for as long as you hold the mouse button and you cannot trigger any of the actions. In some cases, the popup also appears on the wrong location on the screen...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package sample;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TextArea;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
TextArea console = new TextArea();
MenuBar menuBar = createMenuBar(console);
Parent root = new VBox(menuBar, console);
primaryStage.setTitle("Excelsior JET GUI Test");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.show();
}
private MenuBar createMenuBar(final TextArea console) {
MenuItem printHelloWorld = new MenuItem("_Print Hello World");
printHelloWorld.setOnAction(e -> console.appendText("Hello World\n"));
MenuItem clearConsole = new MenuItem("_Clear Console");
clearConsole.setOnAction(e -> console.clear());
Menu fileMenu = new Menu("_File");
fileMenu.getItems().add(printHelloWorld);
fileMenu.getItems().add(clearConsole);
return new MenuBar(fileMenu);
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8160073 menu issues in case of two-display configuration
- Resolved
-
JDK-8247839 Wrong position of GUI elements using multiple HiDPI displays in JavaFX 8
- Resolved
-
JDK-8284419 JavaFX menu bar in different resolutions breaks dropdown
- Closed