1) using DocumentListener
for
2) DocumentFilter
for filtering of
unwanted chars,
chars sequence(s),
these filtered chars could be
3) similair funcionality to provide JFormattedTextField
is possible to input to the JTextComponent
only chars 0 - 9
, decimal separator
, negative sing
,
4)
So what is the correct way to change the text eg. as a result of a KeyEvent ?
use DocumentFilter
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…