Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTextField cleared when focus lost

mh379860lyMar 28 2014 — edited Mar 31 2014

HI Gentlemen,

I have an application of mine, where I am working with a couple of JTextField input fields in a DesignGridLayout panel. All fields are constructed with maximum length, 10, 12 etc. When the contents are of maximum length and I press TAB to jump to the next field, or simply place the cursor on it, everything is OK. However, if the field is not filled up to the end (or, e g, I trim one or more characters from the end), the field gets cleared. This is very annoying, because in this case I do not know in advance, how long the field actually will be (a local telephone number, for example). Can anyone help me?

Thank you very much, kind regards

Miklos Herboly

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 28 2014
Added on Mar 28 2014
1 comment
1,115 views