just a quick question but I have a little Gu set up which has a JFormattedTextField. I want the text box for date entry and I want the textbox to show "yyyy-mm-dd".
When I use the following code it doesn't work:
<pre>dateFormatter = new MaskFormatter("####-##-##");
dateFormatter.setPlaceholderCharacter('_');
//dateFormatter.setPlaceholder("yyyy-mm-dd");
startDate = new JFormattedTextField (dateFormatter);
dateFormatter.getDisplayValue(startDate, "123");
//startDate.addActionListener(this);
startDate.addPropertyChangeListener("value", this
How do I modify the code to get it working? I have tried a few different approaches and the above works if I just want to use the "_" as the PlaceholderCharacter but not when I try to set the placeholder as "yyyy-mm-yy".
Incidentally I'm using java 1.6.
Does anyone know how to resolve this issue?