Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The JTextField-textboxes suddenly stop accepting text. The cursor blinks in it, but you cannot enter anything. I can restart the program and enter text for some time again. Suddenly it won't accept it anymore. Sometimes it won't accept text right after starting the program.
When I uninstall JRE 1.6.0 and put 1.5.0 back instead, this won't happen. However, I have to use 1.6.0 because my program uses the ScriptManager that didn't exist in older versions.
- The bug affects every single JTextField-component in the program, they're all locked out after the bug appears
- Nothing in my code is ever disabling or locking those JTextFields
- I don't use a 3D desktop, like compiz
- Metacity is my window decorator
- I've tried the AWT_TOOLKIT-fix, won't help
- I am using the Sun's Java implementation, since for example Icedtea won't work with the ScriptManager (doesn't have it?)
- I have the latest Sun JRE, 1.6.0 update 6, which I have installed both ways - tried the RPM's from repos and Sun's own BIN installer from their website
- I am using Mandriva 2008.1
- The bug appears under every single Linux PC I've tested, including various distros (at least Ubuntu) and under every single window manager I've tries (including GNOME, KDE, IceWM and some others), BUT the bug does NOT appear under Windows for some reason (JRE 1.6.0 is not available for OS X, so I can't test that)
This is a serious issue that prevents my program to be used entirely! Is there any fix or hack for this? Anything at all?
I think I discovered a solution. I'll still keep on testing it, but so far it really seems to work.
The answer is to use TextField instead of JTextField. Of course, replacing all your components in the program might be time-consuming, as these controls aren't 100 % identical with functions and classes.
There's an even quicker solution: add a useless, extra TextField into your program's main window. For some reason beyond my understanding, this prevents the lock-up bug appearing with the JTextField components! And even if it would happen to appear, just click in the useless TextField component, then back to the locked JTextField. Now you can enter text again! It seems that after one time the lock-up bug won't even appear anymore, until you restart your program.
To me this seems like a definite bug in Java itself, since such a weird hack is needed. But personally, I am just glad I don't have to re-write my apps for Java 1.5.0, that'd be weeks of work.