Hi!,
I'm developing an application which requires that only 165 characters to be in the JTextArea. I've imposed that condition. I've used a static counter for counting number of characters entered in the textarea and also coded to handle the condition when user deletes any string from the text the counter must be incremented by considering length of the string selected.
However now I want to handle the condition when user performs 'cut' or 'paste' option by pressing 'Ctrl+X' and 'Ctrl+V'. I know that default methods from JTextComponent are inherited in JTextArea but I want to get the cut text and know the length of the cut text so as to decrement the counter maintained for characters and increment it while pasting by appropriate amount.