JTextField in which the predefined text in not editable but other text can be appended to it?

后端 未结 5 923
一个人的身影
一个人的身影 2020-12-11 17:58

While going through Java swing I faced this problem. I have a JTextField which has predefined and not editable text. the user should be able to append other text to it but w

5条回答
  •  萌比男神i
    2020-12-11 18:59

    Take a look at DocumentFilter. It should allow you to define a "protected" area of text.

    Examples here and here

提交回复
热议问题