title: Validation through JFormattedTextFields in Java
body: <p>I want to have two textfields which will have the following validations</p>
  
  <ol>
  <li>Both should be Integers</li>
  <li>The value in one textfield should be a integer multiple of other </li>
  </ol>
  
  <p>I have used two JFormattedTextFields to this. This is what i have done till now</p>
  
  <pre><code>NumberFormat updateFormat,sampleFormat;
  updateFormat = NumberFormat.getNumberInstance();
  updateFormat.setMaximumFractionDigits(0);
  updateFormat.setParseIntegerOnly(true);
  sampleFormat = NumberFormat.getNumberInstance();
  sampleFormat.setMaximumFractionDigits(0);
  sampleFormat.setParseIntegerOnly(true);
  javax.swing.JFormattedTextField jFormattedTextField1 =new javax.swing.JFormattedTextField(updateFormat);        
  javax.swing.JFormattedTextField jFormattedTextField2 = new javax.swing.JFormattedTextField(sampleFormat);
  </code></pre>
  
  <p>With the help of this my first part is complete
  Now I am stuck with the second part, i.e. jFormattedTextField1 value should be a Integer multiple of jFormattedTextField2. I think I need to customize my NumberFormat by extending it. But How should I do that? Please help me out </p>