Java applications on Mac using Java7, have a limited window width - java

I'm developing a desktop application for Mac. When I run the application using Java6 it works fine, but when I run it using Java7, the application window seems to be limited to a width 1024 pixels (i.e. when it starts the window is 1024px wide, and can't be expanded/dragged to make it wider). I've tried all sorts of ways to adjust the size (setting window state to maximized, explicitly setting the width, etc.). I've also tried changing where I set the Window size, but so far no luck.
I have tried searching for anyone who has had similar problems, but have not had much luck. The only real hit I got was from an OTN discussion forum: https://community.oracle.com/thread/2617106, but there is no resolution and the discussion seems to be archived so I can't reply to it.
If anyone out there has come across this issue, I'd love to hear about it.
Environment:
Operating System: Mac OS X 10.7.5
Java Version: 1.7.0_55 (Oracle Corporation)
New Information:
Have found a related bug report in OpenJDK: https://bugs.openjdk.java.net/browse/JDK-8046008?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel
This seems to indicate that it is a problem for Mac OS X 10.7.5, which I am using.

Related

Java would only run on Compatibility Mode set to Windows 98 or older

My Java SE (8u111) just won't work. I can't open java programs. Not even the Java Control Panel. I have reinstalled 5 times over, and java just won't work. Everytime i try to open Java (The CP or Program) it appears in Taskmgr, does some work (CPU and Disk rate is picking up), then the rates goes back to 0 (except memory), and Java closes itself without any error notices.
The first time i installed Java, it worked without compatibility mode.
Now, it doesn't.
The only things i did before it breaks are:
I updated Intel HAXM
I turned on Intel VT
I ran Remix OS Player
Java breaks.
After it breaks, i did these to solve:
Uninstall Intel HAXM
Disabled Intel VT
Reinstalled Java 5 times over, one in a different drive
Still doesn't work.
If i apply compatibility mode set to Windows 98 / Windows Me or older, it works. But if i set it to Windows XP or newer, it will not work. Do anybody know why?
I run Java SE 8u111 (on first install, never updated), on Windows 10 version 1607
Intel Core i5-7200U, Nvidia Geforce 920MX, all running on a new 2 week old laptop.
One more thing, i doubt this'll help but, I use custom DPI Scaling (145%)
Test by launching from the console. it's as simple as typing java -jar path-to-your-jarfile into the terminal (can be opened with "win+r" and typing "cmd"). That might at least give you an idea what is the actual problem. --Paul
Thank you Paul for suggesting! After i run my java programs from the console, i found that all of the programs' crashes was caused by java.lang.IllegalArgumentException: 33 incompatible with Text-specific LCD contrast key.
I did a quick google search and read https://www.rarst.net/software/cleartype-install4j-java-bug/.
Then i remembered that, i have modified the registries of cleartype before java breaks. So i re-calibrated the cleartype settings through Windows Control Panel, and now... Everything works! All of the java programs, Java Control Panel, and java on the web is now working!
I might have figured out why the compatibility mode only works on Windows 98 or older. My cleartype parameters was invalid and java could not process the cleartype. Cleartype was implemented on Windows XP (i think). With compat. mode telling Java that this machine is Windows 98, Java would not start collecting configs and information on cleartype and/or load cleartype, making it not crash.
My problem is solved! Thank you!

Java, Raspbian Jessie May 26, how to setup windows fonts

I developed a GUI application with JAVA swing components and run it on Windows. When running the same application on Raspbian Jessie the font and size is different.
I found many solutions to solve this for other Linux implementation. I tried those. Mainly I failed due to different setup file names etc with the new "Jessie" implementation dated 26th of May 2016.
Could anyone please guide me to a proper installation procedure to get the same font appearance on Jessie as on my Windows desktop?
Just to finalise this. As I did not get an answer, I decided to change all fonts in my application to those available in both Windows and Linux.

JavaFX strange rendering on Windows 7

I have just started working with JavaFX and have come to an obstacle. When I open SceneBuilder it renders very strangely. When the window is restored it seems zoomed in, and when maximized it looks better, but still not quite OK and inoperable.
The same goes for HelloWorld example that I created, and examples I found on internet, so I think it is something systemic. I have tried with Java 7u71 and with Java 8u25. No change. Please help if you know how to fix this.
After reading system requirements (http://www.oracle.com/technetwork/java/javafx/downloads/supportedconfigurations-1506746.html) I came across this line:
To avoid rendering issues on Windows platforms, upgrade the ATI driver to Catalyst 11.09 or later.
If you have a old laptop like I do (with ATI FireGL V5200 and ATI driver 8.561.0.0), try to disable HWA. I did this by setting JAVA_TOOL_OPTIONS in Windows Environment variables. See answer: How to disable or bypass Hardware Graphics Acceleration(Prism) in JavaFX
For Java 7: JAVA_TOOL_OPTIONS=-Dprism.order=j2d
For Java 8: JAVA_TOOL_OPTIONS=-Dprism.order=sw

windows 7, some SWT dialogs are showed incomplete

I develop a RCP on windows XP, but when run on windows 7, some dialogs are showed incomplete. Usually, the widgets at the bottom of the dialog only show half, the other half were hidden because the dialog not big enough.
The problem happens on a win7, all the dialogs in my XP are displayed OK.
And I try to change resolution of XP and win7, At all resolution xp performs ok, but win7 failed.
I generated some dialogs of swt and jface, they are performs ok in XP, and incomplete in win7. \
Does anyone has some ideas? Thanks
All I can advise is to update your RCP to the newest version. SWT/JFace needed to be adapted to the specifics of Windows 7 UI, so if you are using an older version, it is bound to cause problems. To get any kind of advice more specific to your situation, it's not going to happen without a specific piece of your code that reproduces the phenomenon.

Java 6 Hardware Acceleration on Mac OS X

I have a java application I wrote that loads up a TTF font and uses the drawString method from Graphics2D. This gets called every 50ms with the x and y positions changing each time to make the text move. When I run the program on Windows, I get 0-1% CPU usage, but on Mac I get about 75% usage. This Windows machine does have a better CPU but there's no way there should be that big of a difference. I think it has to do with Hardware Acceleration and I want to know how enable it. I found some Mac specific Java properties, but none of them lowered my CPU usage. Any ideas how to increase Java 2D performance on OS X? Thanks.
EDIT1: I thought that these properties would help but they didn't.
System.setProperty("sun.java2d.opengl", "true");
System.setProperty("apple.awt.graphics.UseQuartz","true"); System.setProperty("apple.awt.graphics.EnableQ2DX","true");
EDIT2: You can download the project source and byte code here: http://drop.io/ExampleScreenSaver
EDIT3: Since drop.io no longer exists, I uploaded the project to Google Code. Now you can browse the code without downloading it. I still have no idea how to approach this problem so any help would be appreciated.
Run the profiler in "jvisualvm" to identify where the time goes.
Apple JVM font handling is specific to MacOS X. For instance, if a glyph is not found for a character in the current font, the JVM looks for another font to display the character. Also, antialiasing is enabled by default (you should check that you have it enabled on Windows if you want to compare).
I am not surprised Apple's implementation is using more CPU.
OpenGL can be enabled when calling java e.g.
java -Dsun.java2d.opengl=true MyJavaGame
Too enable opengl from inside your java application
System.setProperty("sun.java2d.opengl", "true");
Not sure how this pans out on the iOS / Linux / Android and may require more looking into.

Categories

Resources