Character « Text Input « Java Swing Q&A





1. How do I set the value of a JFormattedTextField with a placeholder character?    stackoverflow.com

I have a formatted text field for ip address:

ipmask = new MaskFormatter("###.###.###.###");
ipmask.setPlaceholderCharacter(' ');
field = new JFormattedTextField(ipmask);
field.setValue("111.222.333.444"); works but field.setValue(" 10.222.333.444"); does not work field.setValue("10 .222.333.444"); does not work field.setValue("10.222.333.444"); does not work What is the ...