I have a problem with re-size of the AWT Applet Frame when Frame.setResizable(false) is set and I want the frame to resize based on the component size that is present in side it. Since its using BorderLayout by default.
I see this problem only on RHEL 6.0 based machine not any other machines with Java 8.
Also please advise me on how to install Java on a RHEL 6 machine manually.
Steps to recreate:
Increase the font size to a value >=20 and check if the screen would re-size.
Decrease the font size to it previous value i.e. 12 or 14.
Repeat above steps two are three times you will see the problem.
Here is the code. Please correct me if I missed some thing here. I have removed the Applet and made it as a normal application but I still see the issue.
The Applet was written very long time ago. I think 20 years back we are now seeing problem with it. With UI and Fonts. The actual application simulates a remote terminal, where you can get a remote session to a machine like Putty.
The canvas is re-sized based on the font size, there is menu that shows the fonts and the sizes. It will resize the canvas based on it. I am creating a new Image using this font and setting it to the canvas.
I think one suggestion is to move to Swing, I am not sure but I can try that and check if it solves my problems.
Here are the results for Java:
bash-4.1# which java
bash-4.1# java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build pxa6480sr1fp10-20150711_01(SR1 FP10))
IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 20150630_255633 (JIT enabled, AOT enabled)
J9VM - R28_jvm.28_20150630_1742_B255633
JIT - tr.r14.java_20150625_95081.01
GC - R28_jvm.28_20150630_1742_B255633_CMPRSS
J9CL - 20150630_255633)
JCL - 20150711_01 based on Oracle jdk8u51-b15
You might do well to move to JavaFX; otherwise in two years you may find you have to migrate the app again.
I searched for the name of your Java installation, which is obviously 1.8, to see whether it was the recent update, but didn't find anything. I thought the IBM runtime was fully compliant with the JLS so it ought to do what you want.
The way I install Java on Fedora is like this:-
1: Make a java folder somewhere and if I don't already have full access use chown to get access.
We are planning to move the application to JNLP based RIA then I think we would need to move it as Java FX app.
I ran the code on several platforms and the re-size happens properly. I only see the issue on Linux specific RHEL 6.0. Ubuntu also worked fine. Not exactly sure what the problem is, we are using IBM JDK 1.8.
posted 4 years ago
Well, I was on Feroda 24, which is related to RHEL, but isn't it weird that there should be a RH/Fedora problem like that.
Sorry I can't help more.
Thanks for your help Campbell.
I have raised a bug for this with IBM JDK internally. They say the Window event for size are not set properly when the font is changed.
This issue is with JDK 6, 7 and 8. They are still working on this issue. Just an update I am using fluxbox as X11 window manager.
Also found that Java 7 and 8 has issue with Font configuration, the standard way does not work on Linux. This bug is reported and not taken care till now, its expected to spill over to JDK 9 releases as well.
FYI bug link.
posted 4 years ago
My pleasure, and sorry I wasn't more helpful. But I had the same problem using the Oracle JVM.