I have one jtextarea component in my GUI.I have to limit the maximum row size is 5.What i have to do?
Printable View
I have one jtextarea component in my GUI.I have to limit the maximum row size is 5.What i have to do?
I dont want to move the cursor.I tried with
evt.dispatchEvent(evt);
But its throwing some exception.
I tried with the following code using KeyTyped Event like,
private void tfBannerKeyTyped(java.awt.event.KeyEvent evt) {
if(tfBanner.getText().length() > 10)
evt.consume();
}
But i can copy and paste to the textfield.I don't want to do that.I have to limit the length.What i have to do?