We are using Swing UI for our project.
Sometimes we observe a peculiar behavior in our application.
Sometimes if we type any characters in any textbox, it comes in reverse order.
eg, if we type abc, it types a , then b before a and c before ba.
So finally, it ends up in wrong inputs in the screen. It generally happens when the screen is left idle for a long time.
below is a method used in our code.
This method is in an innerclass which is extending PlainDocument.java class.
Can you please let me know if anyone had come across this problem before and possible solutions?
I know it's a bit late, but I have experienced this problem after my application has thrown an exception. After the exception, all text fields have the same problem (text appearing in reverse order). Also, I experienced some rendering bugginess. The solution was to fix the exception.
The other possibility is the localization settings with directionality of text, ie. settings having to do with ComponentOrientation.
subject: Swing textfield contents appears in reverse order