JavaFX 3d samples - java

I have just started with Java and the first thing i did was to download the Java SE JDK 7u40 bundled with Netbeans.
I am on ubuntu 13.04.
When i tried out the samples from JavaFX on Netbeans specifically the Cube3D sample when i ran it strange results came out.I had an empty window with small yellow square on the top left of the window
rather than a 3d Cube on the window.
Similar problems occur with all the samples that have 3d in them.
However when i do this on windows enviroment everything runs properly (windows 7 to be precise).
Someone any reason of why is this happening?

I think this page contains the answer:
http://www.oracle.com/technetwork/java/javafx/downloads/supportedconfigurations-1506746.html
It states that: ...On Linux platforms, graphic hardware acceleration is only supported for Nvidia cards (proprietary drivers only).
Cheers.

Related

My Java apps appear enlarged and distorted when using JRE 9 and above

I've many Java apps that I've created over the years. I've been using Netbeans and JDK 1.8.xx. I noticed that when I run my apps using JRE 9 and above that they appear slightly enlarged and somewhat distorted. Including Jframes, Swing controls and drawing canvas. Has anyone else experienced this problem, or have a solution?
TIA,
grecinos
Edit:
As per request, here are some screen captures:
Before (with JRE 1.8X)
After (with JRE 9+)

JavaFx Window white after graphics driver crash or update

I recently noticed that open JavaFx Applications are blank (white scene) after a graphic driver crash or update and i am wondering why that is since Swing applications, Windows, Eclipse or Chrome show now problems.
I now that JavaFx is rendered via GPU but so are Websites in Chrome.
Can someone explain to me why a JavaFx Application ist not usable anymore after such driver crash or normal driver update.
P.S.
At work we have some PCs that suffer multiple driver crashes daily this seems to be an issue with intel GPU and Windows 10 drivers for some of our workstations.
Well, the most likely explanation is that Java graphics libraries do not not cope with the GPU drivers crashing. Its not that surprising (to me) that this happens. After all, it is a bug in the OS platform.
There's not really much you can do about it except (maybe) running the JVM with graphics acceleration turned off. This Q&A explains how:
How to disable or bypass Hardware Graphics Acceleration(Prism) in JavaFX
A better long term approach would be get a fix for the flakey drivers. Have you talked to the PC vendor? Have you tried looking for a driver update from Intel for your graphics chip / card?
Another way to approach this (if you had an Oracle Java support contract) would be to ask Oracle support for help / advice.
Why does it happen on Java and not Google Chrome? Maybe because Google Chrome's internal architecture uses a different process for each browser window / tab. So when it detects a GPU crash, it may be able to nuke the process for the tab and start a new one ... pretty much transparently to the user.
This is just a theory ...

Java Swing component black on second screen bug

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.

Artifacts when drawing Qt & Java apps after durable work on Ubuntu 15.10 (and other)

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».

Java application drawing strangely

I have a legacy Java application that uses Java 1.3
It works fine on windows Xp but now I need to make it run on windows 7.
I have installed the 1.3 jdk however when it first loads, the app won't render properly. Bits of the screen just show grey background, selecting buttons won't load a new screen etc.
I do know watching the output from the app it just purely graphics not rendering properly.
However if I press "Ctrl-alt-delete" and then just press "cancel" the software runs perfectly.
If I have a second monitor plugged in, it runs perfectly.
Has anyone got any suggestions how to make app run perfectly first time.
Thanks
Firstly, update your java, no excuses not to.
You can try the hack of resizing your component to a different size and then back again. I find this is the best way to make sure that swing doesn't do this sort of mischief with black squares here and there.
These things happen from time to time with non native tools for desktop development as opposed to those specifically designed for the targeted platform.

Categories