I have recently started to notice that when clicking on some components like MenuItems in a MenuBar, or Choicebox that before they actually show up it takes about 2 seconds.
I would click on a choicebox and then wait 2 seconds before the choicebox items come up. This is also with components from third party libraries like ControlsFX.
The strange thing is that this is for ALL java applications that use JavaFX. Not just my application so a bug on my end is out of the question. I have tried uninstalling all java versions and installing a lower version to no avail.
My current java version is 1.8.0_45 (JDK) x64 on a Windows 8.1 Pro x64.
I am certain it is not my computer that is not performing well.
EDIT:
There is litterally nothing that I could find on this matter. I tried asking the Java Community on their website but my post got deleted for an unspecified reason.
EDIT 2:
After some research I have noticed that java puts error entries in the windows event logbook http://prntscr.com/6vnlww (sorry it's in dutch) and please look below in the comments for a ProcMon dump of everything that happened between me clicking on a choicebox in java and the choicebox opening up the item choices.
Related
This question already has an answer here:
addKeylistener() not working
(1 answer)
Closed last month.
I am making an RPG game in Java using my Swing-based engine, and everything works on my FreeBSD as well on Linux, but on Windows it seems like the keyboard handler is broken. I have no idea why it happens, the same JAR file works good on Linux/BSD.
I have no source why does this not work as no error popups in the console and everything runs as expected except for the key input.
The game is too large to provide source scraps here (I have no idea what is wrong), but it is on my git: http://codeberg.org/glowiak/gnengine
Package com.glowiak.gnengine contains the engine, com.glowiak.myrpg contains the game and that's all worth noting.
I tried switching JREs but nothing did fix it, on Linux OpenJDK ran it fine, on Windows it did not.
On windows, if you click the game window, then press the Tab key, the controls then work. This is because when you press the the Tab key, you are setting the focus onto your JPanel, which is required for a Key Listener to work properly in java swing. For more details, see this answer by hovercraft full of eels.
My recommendation would be to follow the advice of that answer, and instead of using KeyListeners use KeyBindings.
I installed Eclipse IDE for Enterprise Java Developers 2020-09 with WindowBuilder 1.9.4. Then I tried to create a test application: SWT/JFace Java Project with a JFace ApplicationWindow.
My problem is that I cannot drop anything on the window directly in design mode. It is possible to add widgets to the main container in the components tree. But they seem to be hidden behind the parent shell (I could see this from setting a background color for it and when I add them I can see their bounds, but then no longer). It is not possible to resize the application window in design mode either.
However, when I do "Test/Preview...", the widgets are there. And also when I run the program, as they should as they are in the code. In the latter case also the resizing works (not with "Test/Preview..."). The resizing seems to work at first, but then it snaps back to a minimal size where only the menu and toolbar fit in the window,
This is so with any such project. I first tried to import a program I had written in an older version of Eclipse. There I have tabs in a composite in the container. They seem to be hidden, too (and misplaced, also behind the toolbar). But when I run the program, everything is fine. I first thought I might have messed something up in the program, so parsing gets sidetracked. But that cannot be it as the problem already arises in the simple test program where I have just one widget and the default code.
I have tried quite a few things to get around this, eg. reinstalled the IDE, installed an older version, installed an older version of WindowsBuilder in case this is a bug in either. But to no avail. Has anyone experienced the same problem? Seems like there is a simple mistake on my part. Something I would have to change in the settings or maybe the program?
But I have no idea where to look. Could it have to do with the JRE (OpenJDK15U-jdk_x64_windows_hotspot_15_36)? Had to take that as the download from Oracle does not work for some reason. There is a warning that it is not exactly compatible. But then the program works fine, so it cannot be at such a basic level? Any ideas very much appreciated as I am totally stuck at this point.
There is no problem with designing eg. a JFace dialog. Everything works as expected, I can drop widgets, resize, etc.
Here is how it looks:
Brute force "workaround": I go back to Oxygen where things are working fine. But somewhat of a defeat because I am stuck with an old version, which is a deadend. IIRC already going to Photon posed insurmountable problems for me (certainly my fault as I am not that good at the nitty-gritty). Would still be very interested in an answer to my question. Urgency is now lower as I can at least keep working on my program and let my frustration die down after two days of futile attempts.
[Edit: I only tried the resizing in Oxygen 32-bit, that worked, but did not check whether the problem with dropping a widget on the application window was also there. Then I tried to get the 64-bit version to run, which I could not do. There is apparently a problem with Java > 8. Installation of Photon worked finally. However, while resizing is okay there, I get the same problem with dropping widgets and that they appear to be misplaced (upper left corner of the area seems to be behind the toolbar. The "workaround" unfortunately went nowhere. So I am again more interested in an answer than I thought.]
[Edit 2 as per Oct 12: Since I could not solve this problem, I decided to redo the GUI with a SWT Application window. That lacks some of the functionality of a JFace Application window (I especially miss the ease of Actions). So it seems like a step backwards, and it caused some extra effort. But then the upside is that I had to rethink a few things about the structure anyway, which means I was forced to do that sooner than later. But still would like to get also JFace Application windows to run. Pressure is no longer there, but out of interest what went wrong.]
I developed a somewhat simple GUI in Java Swing, and for some reason I am seeing some spooky behaviour.
On one computer when the swing window is open on the laptop's own screen it looks normal, but when moved to the second screen it turns completely black, even when it is partly in one and partly in the other it is shown correctly on the laptop screen and black on the other.
I can not reproduce it on my own computer (even though I have three screens), so I wanted to ask if anyone else has had similar experiences.
One idea to a reason could be that the laptop and second screen has different color depths, and that is messing with it.
Any pointers as to why it happens and a solution would be most welcome.
I just witnessed the same behavior when trying to use Freemind on my secondary monitor. A quick Google seems to indicate that it's a Java bug.
More context :
JRE 1.8.0_121 (latest version)
Windows 10
the bug happens whether the second monitor is configured on the left or on the right of the primary monitor (so probably not an issue with negative screen coordinates)
the really spooky part is that FreeMind displays properly if I drag the window to the secondary monitor slowly enough so maybe there's an issue linked to refresh rates.
the issue may be linked to the zoom factor set up on each monitor (125% on my primary vs 100% on my secondary) as the window visibly resizes when I move it from one monitor to the other
Hope this helps.
NB: this should be a comment rather than an answer, but I don't have enough reputation points yet ;)
Edit April 2018 :
For those still stumbling on this: on the same PC, the bug has disappeared after some software updates. I'm now running JRE 1.8.0_144, Windows 10 Pro 1709 (build 16299.371). My best bet is that a Windows update fixed the issue; window resizing and zoom factors now work much better than a year ago for legacy/Java applications (JMeter, Gimp).
I met this issue with apache-jmeter-r1839892 (nightly build of jmeter 5), my environment information is like below:
JRE 1.8.0_101 32bit
windows 10, Version 1607 build 14393.1944.
Inter(R) HD Graphics 530
NVIDIA Quadro M1000M
After I upgrade to JDK 10.0.2 64bit, then it works.
The root cause for me is most likely mentioned:
http://www.drastic.tv/support-59/supporttipstechnical/66-javaondualmonitors
Below solution mentioned in above link works as well with JRE 1.8.0_101 32bit
Start->Control Panel->System
Click the Advanced Tab
Click the Environment Variables button
Click the New button
For Variable name: _JAVA_OPTIONS
For Variable value: -Dsun.java2d.d3d=false
I also found another workaround: open jmeter, set the 2nd monitor as the main display in Windows and then switch back the 1st monitor as the main display.
I also tried to upgrade to JDK 1.8.0_181 64bit, the issue persists.
Short history of problem:
After upgrading to Ubuntu 15.10 I had some problems with any Qt-apps after durable work with IntellijIDEA. In apps like tortoisehg I saw painting problems, like not filled areas or shifted text. It was fixed after reading post in archlinux forum. Just set up property for Qt and changed my openjdk to oracle's.
The next story, that possibly is relative to first, consists in my work in IntellijIDEA and other Java swing applications (like Netbeans RCP): after long term working some dialogs became transparent, were inaccessible or just clicked through it to something under. Reopen of the dialog or window helps, but my colleagues have same problems on other OS, like Fedora (with KDE).
This bug is annoying, because our product is written on Netbeans and works under *nix distributive. Sometimes we stuck with problem of click-through problem: dialog or window just clicked into window after it.
I think the problem in wrong settings of x-server and in Qt- and Java- toolkit clash. This leads to artifacts on both application groups.
Does anybody stuck with this problem and do you have some ideas to resolve it?
The possible reason is described in Russian here (https://toster.ru/q/267833?e=3090918#clarification_329784).
Some bugs of it are found in:
https://bugs.kde.org/show_bug.cgi?id=350976
https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/1512760
Summary: the Java and Qt applications use shmem that is never cleaned by Java, after some time Qt cannot use this memory to work right. Google it with words «Java Qt shmem».
I have a bit of a weird problem. I have a swing application that has some windows with are built with JavaFX (Don't ask why I did this, I had to for due to project delivery time restrictions). The app is 50% Swing and 50% javaFx. Anyway what I found when I started deploying the application to customers is that some of the JavaFX JFXPanels that I am using don't display properly
To be more precise JFXPanels that I have in my main window, which are crested as the application starts, are showing fine. Other JFXPanels that I include in other windows that popup while using the application don't display correctly. The JFrame opens up but its empty of JavaFX components. The weird thing is the when I enable Java console (Java-settings -> Advanced -> Show console) everything is working fine.
The same problem I have in all operating systems I deployed the application. 32 and 64 bit.
also I am using JRE 7u25 in all machines.
Any clues anybody?
Maybe it's related to bug 8021381?
I appears to be fixed in Java 7u40-b38 according to the release notes
So I suggest to try out the Java 7u40 early access release (Download).