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?
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.
When I was installing IDEA, the texts in the installer and later in the setup window weren't displayed properly, see pictures below.
Im on Windows 10. I do not have the standard Windows font, I set it to Bahnschrift, could this be the issue? I tried reinstalling, but it didn't help
The code is displaying normally
I am running Windows 10 64 bit and have JDKs and JRE 8 (1.8.0_152) and 9(9.0.1) installed.
I have a GUI (Swing) that I am working on in IntelliJ IDEA Community 2017.2. I have setup Icon and Font sizes to my liking and the program runs and looks when it is run inside IntelliJ. I have created an Artifact (JAR) and everything shows correctly IF it is run inside IntelliJ. However, IF I run (double-click) the JAR file outside IntelliJ, all icons and text are bigger/scaled up and they look blurry. I have IntelliJ run all projects with 1.8.
I have read about Java/Swing DPI scaling (apparently Swing reports that it can do scaling or something like that and in turn Windows tries to scale up the program) but I do not fully understand what that is and what is going on.
I have also looked at using launch4j because if the JAR is wrapped it might not suffer from DPI scaling, is this correct?
What can I do to run my JAR file and that it looks exactly as it looks inside IntelliJ?
Thank you very much!
P.S.: This is the program when run inside IntelliJ
This is the program when running (double clicking) the JAR
I have solved the problem!
I found this post here:
How to set the DPI of Java Swing apps on Windows/Linux?
Even though, the OP had a different problem (the fonts on his Java Swing app are too small and the app DOES NOT scale up automatically) the following two answers helped me find the solution:
The first answer shows some research on the Swing LAF (Look And Feel) and that only JavaFX supports DPI scaling to 150% on this person's system.
The second answer tells to run the app using JRE 9!!! and explains that it supports DPI scaling for Swing and AWT.
So... I set up IntelliJ to use JDK 9 and... Ugly icons and scaled-up text showed up in the app running inside IntelliJ!!!
Then it hit me!
I have both JRE 8 AND JRE 9 (and also JDK 1.8 & JDK 9) installed in my system... Of course my system is using the latest one!!! (I was just to blind to see that, actually it never crossed my mind to think about this)
Basically, I was developing in IntelliJ using JDK 1.8 and then running the JAR file using the default JRE on my system (JRE 9 which has DPI scaling capabilities for Swing applications).
I ran my JAR file explicitly using JRE 1.8 like this:
c:\path-to-jar>"path-to-my-jre1.8.0_151-javaw.exe" -jar MyJAR.jar
And... icons and text showed up correctly!
Hope this helps someone!
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.
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.