do a GetEditor().getEditorComponent () to get the JTextField , and the
set a Document (extend PlainDocument) on it which will filter out
undesirable input.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Vella, John
Sent: Thursday, February 21, 2002 9:56 PM
To: Advanced-Swing (E-mail)
Subject: What's the recommended way to prevent keyboard input to a text
field?


I need to use an editable JComboBox where I want to prevent the user from
typing any characters other than the caret-control keys(like the left/right
arrows, home, end, etc). The text shown in the text field could be long,
which is why it's important for my users to be able to scroll it. However I
need to prevent them from actually typing into the text field. I'll support
using DnD to get text into the field or the use of the combobox's dropdown
list.

So my question is: what is the "best way" to prevent users from typing
anything into the text field but still allowing caret position control?

Thanks,

John  (using 1.3.1)

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to