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:
Opening Netbeans and creating a new JavaFX FXML application.
I open the FXML file and add a menuBar to the scene.
I set the 'use system menu bar' property to true.
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 (i.e. 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.
I have just downloaded Java 1.8 which was released today and it appears the problems have been fixed.
Related
I'm having an issue with NetBeans, on the first few startups everything works fine, and I even get some projects finished, but then suddenly Netbeans loads but doesn't open, and if I try to reopen it all I get is a minimized menu bar (as if you took the menu bar on the top right of your screen and only displayed that). I've tried uninstalling and reinstalling the application, changing the JDK being used, and failed at editing a config file which I saw suggested on some other threads, this happens independent of the version installed or the JDK used. I'm really lost because I don't even get an error message.
I have a working RCP application which was moved from eclipse 4.7 to 4.11 target platforms. The splash screen of the application is not rendered properly on Linuxes (I have tried Ubuntu 16.04 and Fedora 24). Not a single line changed in the code, so there is obviously something in the runtime which I need to address. Have no idea where to even start looking at this. It appears that the layout rendering is not respected properly.
Here is how the splash screen looks with Eclipse 4.7 Oxygen runtime:
And this is what I get with Eclipse 11 runtime. Seem like some CSS issues but this is an old code base, there are no CSS tricks. Pretty basic swt grid layout, same code:
On the latest Ubuntu (19) it looks even weirder, the radio buttons and check boxes are not painted properly when selected:
I don't see this issue neither on Windows nor on MacOS.
Only on Linuxes. Any secret behind this?
I am using install4j version 6 to create setup for my Java GUI application
I have compile my project with jdk 7 and also bundled jre7. I have been doing this over the time and it work seamlessly. I have just tried to do this with a new project and as i create the installer, when clicked a black screen displays please help me see this screenshot.
Any help please, to me i can not figure out the cause of this.
black screen
The "black screen" is a console window.
On the Installer->Screens & Actions step, select the installer and deselect the "Windows console executable" property, you probably have selected this accidentally.
I just started to develop an application with JavaFX and this is the first time I am using JavaFX.
My application works fine, but sometimes (happened twice) when I start the application, it only shows an empty window, without any content. When this happens, no matter what I do, I cannot get it fixed until I restart the PC. When I restart the PC, the issue automatically gets resolved.
Following are my environment details
Windows 7 64bit.
jdk1.8.0_131 (64 bit).
Build with Maven v3.2.5
Developed in IntelliJ IDEA 2017. (When issue occurs, window is empty
when opened through IDEA, and opened through
myapp-jar-with-dependencies.jar built by maven)
What could be the cause of this issue?
I am new to Eclipse and Java programming having mainly worked with Microsoft Visual Studio.
I installed Eclipse (Kepler 4.3) with no issues along with WindowsBuilder and SWT.
I created a new project adding in references to SWT, both WindowsBuilder JARS, and resty. Into the project, I created a new package and selected a SWT composite. I gave appropriate names.
The GUI designer came up with no issues. I added in a couple of controls. The idea is to create a hello world application, display that application, and build it. Eclipse has automatically build checked.
Okay, the IDE in designer view shows the GUI of my Hello World application and the source view the source, so no problems there.
I press Run, and the first time I had to select a run configuration, which I selected EclipseStarter. There was not many options. I click on run and nothing happens.
If I go to the project's bin package folder, I see a file with a ".class" extension.
Why does pressing Run|Run (Ctrl+F11) do nothingness? There is a brief hour glass showing, but then nothing after that.
How do I launch the application from within Eclipse?
Is the generated ".class" file the correct runtime? I double click on that and Windows does not know what to do with it?
The end platform will be CentOS, but Java as I understand things, should be platform independent, so my Hello World application should run on my Windows 7 Pro box just as nicely. (I did not try CentOS yet) as I want to see it work on my desktop and know what file to copy over.
I think you selected the wrong option EclipseStarter.
Try running it as a Standalone Java Application.
It is a Standalone Java Application that you're building, right?
(I mean, the analogue of a Windows Forms App in .NET)
1. I guess because you selected the wrong type.
2. Ctrl+F11 is for Running it, F11 only is for Debugging it.
3. The class file has to be run by a JVM, Windows cannot run it directly,
it is not anything like a native executable or like a .NET assembly
(which Windows 7 knows how to run). But as you're using Eclipse you
already have a JVM.
The solution is multi-fold.
I had to delete Eclipse and install the 32-bit version of everything. That simplified life, as 64-bit caused issues running.
Create a new package
From the toolbar, select "Create new visual classes" drop down. Select "SWT" --> "Application windows".
Create the application window
Press the play button, 8th icon having selected the package first.
That enabled to run my Hello World on Windows. The output is a .java.
I still have a problem running from the command line, but that is a different issue.
Summary: My main issue was creating a SWT application window first and that I should have 32-bit for everything.