This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Disable Caret in a Document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disable Caret in a Document" Watch "Disable Caret in a Document" New topic

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
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.

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!
I agree. Here's the link:
subject: Disable Caret in a Document
It's not a secret anymore!