title: How to make JFormattedTextField accept integer without decimal point (comma)?
body: <p>I used <code>JFormattedTextField</code> with<code>NumberFormat</code> in this way:</p>
  
  <p>-Creat a <code>JFormattedTextField</code> refernce</p>
  
  <pre><code>JFormattedTextField integerField;
  </code></pre>
  
  <p>-Create a <code>NumberFormat</code> refernce</p>
  
  <pre><code>NumberFormat integerFieldFormatter;
  </code></pre>
  
  <p>-In the constructor:</p>
  
  <pre><code>integerFieldFormatter = NumberFormat.getIntegerInstance();
  integerFieldFormatter.setMaximumFractionDigits(0);
  
  integerField = new JFormattedTextField(integerFieldFormatter );
  integerField.setColumns(5);
  </code></pre>
  
  <p>..........</p>
  
  <p>I meant to use it with integer numbers only, but when I type numbers like 1500 it is converted after losing focus to 1,500 , and exception thrown this is the first line of it:</p>
  
  <blockquote>
    <p>Exception in thread "AWT-EventQueue-0"
    java.lang.NumberFormatException: For input string: "1,500"</p>
  </blockquote>
  
  <p>When I use <code>JTextField</code> instead of <code>JFormattedTextField</code> All integers accepted normally, But the reason why I want to use <code>JFormattedTextField</code> is to benefit from its input restriction advantages.</p>