Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Swing / AWT / SWT
Disable Caret in a Document
Mike DeStefano
Ranch Hand
Posts: 36
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 1535
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
textArea.getCaret().setVisible(false);
Matti Poro
Ranch Hand
Posts: 41
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can still use the arrow keys to scroll the text area after setting the caret invisible.
JTextArea.setFocusable(false);
Mike DeStefano
Ranch Hand
Posts: 36
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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!
-Mike Destefano<br />"Sometimes you feel like a nut..."
It was the best of times. It was the worst of times. It was a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Displaying a "floating" JLabel
obtaining mouse pointer position within a document
Columns vs letters
select a row inJTextArea using CaretPosition
how to auto scroll to see the bottom of the jtextarea?
More...