A Document is the model of a text component, and Swing is built for a single model to be able to be used by many views. So the answer to your question as far as I know of is no, this can't be done directly, since many text components can use the same Document.
You state:
It should remove all the excess text(copy/paste have to be taken into consideration too) and a dialog should popout informing user of the limitation. I am still unsure how to achieve that(having copy/paste in mind, without it it can be done easy), so if you have ideas shoot, but I'll need this argument issue solved anyway...
I wonder if you need that much control over input into a JTextArea, perhaps you shouldn't be using a JTextArea. Instead perhaps you should us a JList and completely control how lines are added and removed from this component.