| Author |
Disable Caret in a Document
|
Mike DeStefano
Ranch Hand
Joined: May 24, 2002
Posts: 36
|
|
I have an uneditable JTextArea embedded within a JScrollPane. Is there any way to remove the caret in the JTextArea document so that UP and DOWN don't move the document. Thanks in advance..
|
-Mike Destefano<br />"Sometimes you feel like a nut..."
|
 |
Craig Wood
Ranch Hand
Joined: Jan 14, 2004
Posts: 1535
|
|
|
textArea.getCaret().setVisible(false);
|
 |
Matti Poro
Ranch Hand
Joined: Dec 03, 2005
Posts: 41
|
|
You can still use the arrow keys to scroll the text area after setting the caret invisible. JTextArea.setFocusable(false);
|
 |
Mike DeStefano
Ranch Hand
Joined: May 24, 2002
Posts: 36
|
|
OMG!!! It worked!!! Praise Zeus and the Java Gods! To think disabling scrolling on UP and DOWN keyboard events was that easy! GGGGEEEEEEZZZZ!!! Thanks very much!
|
 |
 |
|
|
subject: Disable Caret in a Document
|
|
|