简体   繁体   中英

Java 1.7 JavaFX 2.2 Troubles on Mac os x Mavericks

I am having some real trouble with JavaFX on my Mac at the moment which originated when experimenting with using the system menubar but has also lead me to discover another problem related to the built in full screen functionality.

Here is what I am doing:

  1. Opening Netbeans and creating a new JavaFX FXML application.
  2. I open the FXML file and add a menuBar to the scene.
  3. I set the 'use system menu bar' property to true.
  4. I build and run the application.

When the application is launched, no menu bar is displayed within the window (as expected) but the Mac system menu bar is still the Netbeans menubar. If I click on the desktop and then back on my application window, the system menubar is correctly displaying the menu from my JavaFX application. I can access the menu and everything now appears to work correctly.

If I relaunch the application, the menu is incorrectly displayed as in the previous example. I use the full screen button on the right hand side of the application window to enter full screen mode. I move my mouse to the top of the screen to show the menu. My application menu is shown but is inaccessible (ie I am unable to interact with any of the menus on the menu bar). If i go back into windowed mode the menu bar is now displayed but is still inaccessible. If I follow the steps in the previous example everything now works as expected except for selecting the Quit Java menu option from the Java menu results in the application throwing the following exception.

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at com.sun.javafx.tk.quantum.GlassViewEventHandler$9.run(GlassViewEventHandler.java:738) at com.sun.javafx.tk.quantum.GlassViewEventHandler$9.run(GlassViewEventHandler.java:720) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleBeginTouchEvent(GlassViewEventHandler.java:720)...

System specifications:

  • Mac os X Mavericks 10.9.1
  • Java version 1.7.0_51
  • JavaFX version 2.2.51-b13
  • Netbeans 7.4
  • Java update tells me I am running the latest version.
  • Mac system update tells me there are no software updates at this time.

What I have tried

My research has led me to various discussions regarding a conflict between Java 6 and 7 on os x Mavericks, and that I should be installing the update here .

I have carried out the following:

  • Completely uninstalled JavaFX Scene Builder and Netbeans.
  • Completely uninstalled JDK 7 and JRE 7 as per the Oracle instructions here
  • Run the installer for the os x Java 6 update linked above.
  • Reinstalled the JDK (version 1.7 u51).
  • Reinstalled Netbeans and Scene Builder.

I was also going to try and revert to an older JDK version (update 45 or lower) but you have to sign up for an Oracle account in order to download these versions.

Update:

I have also tried installing Eclipse and using EclipseFX to create the JavaFX project but still observe the same behaviour.

Any help that anyone can offer will be greatly apreciated.

我刚刚下载了今天发布的Java 1.8,看来问题已得到解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM