title: JTextField stops using MaskFormatter after being cleared
body: <p>I'm doing a Sudoku solver and for that I want my JTextFields to only accept one of the numbers 123456789 as valid input. Therefore I use a MaskFormatter toghether with a JFormattedTextField. However when I clear all the TextFields by doing .setText("") the MaskFormatter doesn't work anymore. After clearing the textboxes I can write anything in them again. Why and how do I fix it?</p>
  
  <p>My code is basically:</p>
  
  <pre><code>MaskFormatter formatter = new MaskFormatter("#");
  formatter.setValidCharacters("123456789");
  Font textFieldFont = new Font("Verdana", Font.BOLD, 30);
  for (int i = 0; i &lt; 9; i++) {
      for (int j = 0; j &lt; 9; j++) {
          southPanel.setBorder(lineBorder);
          field[i][j] = new JFormattedTextField(formatter);
          field[i][j].setHorizontalAlignment(JTextField.CENTER);
          field[i][j].setFont(textFieldFont);
          southPanel.add(field[i][j]);
      }
  }
  </code></pre>
  
  <p>Then when I clear it:</p>
  
  <pre><code>for (int i = 0; i &lt; 9; i++) {
      for (int j = 0; j &lt; 9; j++) {
          field[i][j].setText("");
      }
  }
  </code></pre>
  
  <p>EDIT: Here is all the code, haven't written most of it cuz my friend did it. I'm just now taking over to fix the GUI a little bit.</p>
  
  <p><a href="http://dl.dropbox.com/u/4018313/SudokuSolver.zip" rel="nofollow">http://dl.dropbox.com/u/4018313/SudokuSolver.zip</a></p>
  
  <p>Also, after some more testing it seems like after clearing all the boxes you can type a lot of charachters that should not be there but when you click on another field all of them will disappear. Then if you click in the other boxes the numbers you wrote earlier will appear.</p>
  
  <p>Don't get this!</p>