Yes, but it requires a bit of work.

See this article for an example where I made the first section of a JTextArea un-editable:...