Disable Mac character accents menu while my Java app is running - java

I am building a Java game in Swing, and I have an issue where keyPressed events stop registering after holding the A or S keys for too long on Mac (this is a big problem considering that the game uses WASD movement).
After digging around Stack Overflow, I found out that holding down keys like this suspends focus because it attempts to open the accented characters menu, even though the normal list of accented characters does not appear. When I disable the character accents menu on my Mac, everything works fine. However, I'd like to know if there is a Java-native way to work around this behavior (such as a wrapper for KeyListeners) since I don't want all Mac users to have to deal with this issue.

I had the same question, and the issue was the Java version.
I had JDK 1.8.0_151, but apparently this issue was fixed in some iteration up to JDK 1.8.0_172.
You could fix the issue by updating your JDK for your development and prevent this issue for your users by checking their java version using org.apache.commons.lang3.SystemUtils
e.g.
if(isJavaVersionAtLeast(JavaVersion.JAVA_1_9)) {
/* Insert message/pop-up to update and give link to Java download
* You can exit the program using System.exit(0) or send them to the
* download site or link using Desktop.getDesktop().browse(new URI(url))
* Where url is the URL of the site or link in the form of a String
}

Related

Java Swing Arabic text reversed direction

I had a correctly working/displaying Java Swing app that manipulated text IO in Arabic. Suddenly today, I find every Arabic text word displayed in reverse direction on my MacBook Pro with a Java8u171. To verify it's not something wrong with my programs, I recreated the app on the Oracle Tutorial page and ran it on my laptop. To my surprise, I am getting the same reversed display! Namely, instead of getting this correct image shown below (extracted from the referenced tutorial page):
I am getting this one instead when I build the app as is and run on my laptop:
Could anybody shed light on what happened here please? Thank you.
If you're using a Windows based computer, you're probably fine according to the comments in the original post. For your Mac OS'ers, you need to step away from Java 8 entirely and into Java 11 (or newer going forward). Testing with that gives the desired look shown below. I tested this with my own apps on JTextPane and all those input text components, we're back in business :-)

Oracle Forms running on java 6 Update 45

I have one program, I maintain, that was originally written in Oracle Forms 6i. A while ago I migrated it to 11g. Our users access this Oracle Forms program through their Internet Explorer browser on their Windows 7 machines.
The problem has been that the program only seems to run well for our users, when they have Java 6 Update 45, installed on their machines. Going to a newer version causes problems.
Today, I wanted to get this resolved, so I updated my PC to Java 8.31, and attempted to access my Oracle forms program using IE. (Thanks to Viewing oracle app and getting: java.lang.ClassNotFoundException: oracle.forms.engine.Main I was able to get the form running again in my web browser.)
When my form ran, I found the tab key wouldn't advance to the next field on the login dialogue box. But after I logged in the tab key worked. (The tab key initially not working is a small thing, but it has really annoyed some of our users.)
I then used several different forms. Some worked just fine, no problems. But then when I clicked a button, on one form, it would endlessly try to complete a request; to the point that I couldn't even close the web browser to stop it. (Finally I just used task manager to end my web browser’s process.) This seemed to go in line with what some of our users have reported: (when attempting to use the latest Java) that the Oracle forms application just stops working completely after a while.
Because of these issues our users want to keep Java 6 Update 45 on their machines. I know this is a major security hole, but I haven’t quite nailed down what the solution to it is.
Has anyone else had a similar issue? We're running Oracle Fusion Middleware 11; specifically Forms Services version 11.1.2.0.0
Thanks.
Well this may not be a question that needs answering after all.
I've done some more testing since asking this. Besides the login dialogue box (not responding, as it should, to the tab key) everything else works just as it should.
I still have one form that hangs; but that’s all (and it may be caused by something else). All my other forms seem to work just fine.
I talked with one of my co-workers, and I realized we really need to investigate and determine what version of Java our users really are using. They may not have used the most recent version of Java; which I used with success, today. Or some may be already on it; and that's why they aren't complaining.
At any rate more research, is needed on my part. Thanks to all who read this. If any of you have had similar experience in something like this, still feel welcome to answer/comment.

Oracle Forms 10g Sticky Cursor

I face a really strange problem. The problem is that sometimes the cursor does not listen to mouse, it become suck on the field and does not move to any other field when using mouse navigation but navigation works as expected when using the tab key.
Has anybody else faced the "Sticky Cursor" problem? Oracle support says, that problem is fixed by installing newest Java update, but it didn't help.
I understand the problem you are facing. The last Oracle Forms application I worked on 2 - 3 years ago was plagued by the same issue.
I spent a long time working with Oracle Support investigating the issue but even after applying successive Oracle Form patches, later versions of the Java Runtime Environment and code changes to the Forms the problem remained.
In case it is of use here is a link to question I raised on the Oracle Forms OTN Forum asking if the problem remained on Oracle Forms 11g.
Unfortunately I was never able to resolve the problem. I hope you have better luck.
There are a few different causes for this to happen.
1) You use timers in your application. Just avoid using timers if possible this is a main cause of having problems with the mouse focus.
2) Some versions of java or jinitiator have also problems with the mouse focus. So try to use the latest versions of java 6 (version 24 or above or something like that), you can also use java 7 of course.
3) There are also a few patches of the application server to fix mouse focus problems. You have to check them all. If the right ones are installed this should fix all your problems.
I have the same problem with the "Sticky Cursor" and I tried (just for testing) the following:
If the form has Required Fields, just change the Required property from YES to NO.
If the form has Radio Buttons no visibles, make it visibles.
Try this only to testing purpose and tell me if works because I do that and in some cases works for my apps.

Printing AMCharts graphs on IE8

I'm having a problem printing line graphs from AMCharts.
On my page, the chart is right, but when I try to print it, some spaces are blank.
For example, this image shows how I see the image on my page:
When I try to print it (CTRL + P), some spaces are blank. Look this image:
The problem happens only with IE8 or lower.
In IE9 and IE10 this problem happens when I put in compatibility mode.
In other browsers it works OK.
I need it working in IE8. We have some terminal servers running Windows Server 2003 and can not update the version of IE.
Using another browser is not possible either, because we need multisession and only IE provides this option. We plan to upgrade our servers to a new version of Windows, but it will require some time, and I'm looking for a quick fix.
From what I researched, the amCharts builds the graphics using SVG.
However, in IE8 (or IE9~IE10 using compatibility mode) it uses VML.
Is there any way to make it work with IE8?
Or convert the VML code generated to an Image using Java (language used in the system)?
I researched but dont find anything that can help me.
Is there anything I can do to make it work properly in IE8?

java applet using Next-generation plug-in

I have a web application (struts 1.3, Weblogic 10.3.0, Toplink, Oracle) that has a Java applet which isn’t working in the browser (IE7/8) when the Next-Generation Plug-in setting is enabled in the Java control panel but works fine when it’s disabled. The trouble is that this setting is set to disappear in an upcoming Java release meaning that my users would have to keep using Java 1.6_xx on their workstations as they are currently. I have little influence over which version they use because they are all governed by their local IT departments across the country. So, either I have to find a simple fix to allow the Next-Generation setting to work, or we have to look at replacing/rewriting the applet with something else (but would be a last resort due to funding constraints), most likely something AJAX-friendly so as to avoid the need for a plugin. This application is quite old, written around 2001 before AJAX was really around.
The main window has a left, right, and top frame (JSP’s), as well as a center frame which is where the applet is. The applet has a main content area in the middle and a lower panel at the bottom which has some buttons. The buttons tell the content area (which is basically a treegrid) what to do (Save, Copy, change status, etc ). When I press one of the buttons the entire window (surrounding frames plus the applet itself) repeat inside the area where the applet is. It’s like a kaleidoscope or like a repeating fractal pattern kind of thing, or like when you take a picture of yourself in the mirror and you see the room repeated over and over in the mirror. In this case it repeats for each button press and the repeated set gets smaller each time. Weird!!
So, based on my research, the Java Next-Generation plugin works differently by allowing more than one process or thread whereas the classic plugin only uses a single thread. So my suspicion is that a new process is being spawned for each button press. I tried using the “separate_jvm” applet parameter but it made no difference whether it was set to true or false. I don’t see any other applet parameters which seem to be relevant.
Another idea I had is that maybe it’s something to do with the JSP frameset, maybe something like “target=_top” needs to be added somewhere…but I’m not sure how this relates to applet threads if at all.
Anyone have any suggestions, ideas or experiences that might help?
you can use velocity to handle these type of problem and it will also help you for future enhancement also.
The problem is not related to version of IE but rather to version of Java. Below excerpt from letter of certificate provider (they took it from some forum, so direct link to source cannot be provided):
For JDK version higher than 1.6.0 and below 1.6_15, you can just
clear all kinds of cache in web browser, java console and java control
panel. Then it should works fine!
For JDK version between 1.6_15 and 1.6_30, you should disable the "next-generation java" option in java control panel.
For JDK version higher than 1.6_30, you should turn on "next-generation java" option in java control panel.

Categories

Resources