title: JOptionpane validation with double input
body: <p>I am learning java. I try to declare a double array. For the input method, I would like to use JOptionPane. My question is how can I create the validation for this array.(For example: I want to valid that the salary input will be from 2000 to 10000). I'm sorry for my bad writing. Thank you guys!</p>
  
  <p>Here is my code!</p>
  
  <pre><code>import javax.swing.JOptionPane;
  
  public class Testing {
  
      /**
       * @param args
       */
      public static void main(String[] args) {
  
          double[] salary = new double[10];
  
          for(int i = 0; i &lt; salary.length; i++)
          {
              salary[i] = Double.parseDouble(JOptionPane.showInputDialog(null," Enter Salary: "));
          }
  
      }
  
  }
  </code></pre>