JTextField limit characters while typing without showing last unwanted character

66 Views Asked by At

Scenario:

  • In the db there are existing lengthy words for this textField. I want to load that data when I do an update task.
  • But when I try to edit that lengthy word, it should trim to limited size(get a subString from that word).

Due to the above 2 points, I can not limit the text length directly. And also I want following thing.

  • When I type a new character for that trimmed word, last character should not show. It means currently I am using a keyRelease event, So I can see the last character which I typed before JAVA code check the length. Therefor I want a way to find the length of the word without showing that unwanted character.

Please help me to find a better way to solve this.

0

There are 0 best solutions below