Java Swing Arabic text reversed direction - java

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 :-)

Related

Disable Mac character accents menu while my Java app is running

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
}

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.

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?

My first applet won't load in browser

I've been learning java for a while. I recently decided it's time to leave the simple console applications and start making applets. Everything is great so far except the fact that I can't find a way to run any applet made in eclipse on either of my browsers.
I downloaded this example to make sure everything is alright and it still renders the very same result when loaded in the browser.
When I open the html file the only thing in the tab is the border of the applet and the line "Error: click for details" top left. After I click the Java Console comes up and all that it says under the block of key instructions is:
Detected from bootclasspath: C:\PROGRA~1\Java\jre7\lib\deploy.jar
I don't even know if this is any sort of error report or just a notification... after the console is cleared it won't come up again...
I tried with: IE 8 and Chromium 17 on winxp 32
Applets on webpages run fine.
Please help me! This makes me very sad. The fact that I don't know anything about JRE and whether it needs any further configuration after installation gives me hope that there might be a simple and trivial solution to my issue.
Not too sure what your issue is right now. That's not an error report, just saying that deploy.jar, from the JRE, is being used.
When you say the example "renders the very same result" what result is that?
Can you properly run the "this example" you posted?
Are you compiling the project properly into a jar?
Are those jars in the same directory?

Printer output from java applet is no longer in vector format?

I have an online sheet music generator that for draws sheet music graphics to an area about 600pixels square. This looks OK on the screen but if printed each note would look blocky.
I always used to be able to print this applet in Internet explorer and get a full vector output of the sheet music so the notes were perfectly rounded, even though they are only a dozen pixels in radius.
Sometime over the summer there must have been an update to java, or (internet explorer?) so my printouts now look horribly blocky. Can anyone think of a reason for this?
I have two versions of my applet, one is double buffered for animation purposes,(which would obviously produce a rasterised image unsuitable for printing) the other draws straight to the screen which is the one which I have been using for printing and has worked fine up until now!
Any help would be much appreciated as I use this program professionally and I have to print several thousand pages from it next week!
Can anyone think of a reason for this?
The obvious answer to that might be 'a change to Java', which can be tested by disabling the later Java version in the Java Control Panel (1), and using the earlier version only.
(1) Java Control Panel
(Close the Java Cache Viewer.)
Navigate to the Java tab of the JCP.
Select the View button
In the Java Runtime Environment Settings dialog, check the earlier versions, uncheck the later ones.
Java Runtime Environment Settings dialog
If that works
Use the earlier version for the 'several thousand pages'.

Categories

Resources