• 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
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JTextArea making non editable

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi floks,
is it possible to make some portion of the text to be
non-editable?
Thanks,
silva.
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by selvas kumars:
Hi floks,
is it possible to make some portion of the text to be
non-editable?
Thanks,
silva.


It is possible, but you would have to capture all of the keyboard events and when the user tried to edit the portion you wanted read only, you would have to "eat" those keystrokes somehow. I have done this in C++ and C but not java.
This sounds like a bad idea and I think that you are going down the wrong road. Most chat programs have one textarea for display and a different textarea for typing.

[This message has been edited by Rick Fortier (edited June 16, 2001).]
 
Slime does not pay. Always keep your tiny ad dry.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic