LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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.

Notices

Reply
 
Search this Thread
Old 05-23-2008, 12:57 AM   #1
make
Member
 
Registered: Apr 2004
Distribution: Mandriva, Ubuntu, openSuSE, FreeBSD, OpenSolaris, PC-BSD
Posts: 185

Rep: Reputation: 30
Java 1.6.0u6 JTextField: Cannot enter text


Did I just discover a new Java bug?

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.

Some info:
- 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?

Last edited by make; 05-23-2008 at 12:59 AM.
 
Old 05-24-2008, 07:16 AM   #2
make
Member
 
Registered: Apr 2004
Distribution: Mandriva, Ubuntu, openSuSE, FreeBSD, OpenSolaris, PC-BSD
Posts: 185

Original Poster
Rep: Reputation: 30
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.
 
Old 05-14-2013, 03:19 AM   #3
m3lis
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
same for java 7

hello. i have stumbled across the same issue, and I am using java 1.7

have you found any further information from java regarding the issue, or another workaround?

any help appreciated

thanks
 
  


Reply

Tags
java, jre, type


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LaCie LightScribe Labeler: Can you enter text? Bazbo Linux - Software 1 04-13-2008 09:48 PM
can't enter text in terminal lpn1160 Linux - General 4 11-04-2005 02:39 AM
Can't enter text in certain Java text fields TheBelush Linux - Software 4 04-27-2005 05:29 PM
How do I enter Unicode text in X11? uman Linux - Software 0 12-07-2004 10:14 PM
what is the best way for student to enter java code Brain Drop Programming 11 01-01-2004 02:34 PM


All times are GMT -5. The time now is 07:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration