title: how to compare a Double Value in if statement in java?
body: <p>I have a desktop application with textboxs that contain a price values. As an example if i input 25000</p>
  
  <pre><code>Double priceSec = Double.parseDouble(cusPrice.getText());
  </code></pre>
  
  <p>i'm passing that 25000 as a double value</p>
  
  <p>so now i want to compare that value and check whether it is empty or not?</p>
  
  <pre><code>if(cusPrice2.getText()==null || cusPrice2.getText().isEmpty()){
          Double priceSec=0.0;
          }
  </code></pre>
  
  <p>i know i can create an else condition for </p>
  
  <pre><code>if textbox !=null
  total=txtbox1+txtbox2+txtbox3;
  </code></pre>
  
  <p>if textbox value is empty or not empty. value should be there in total.
  but  in my code ,it displays as null.</p>
  
  <p>Do i have any other way to do that?
  can you tell me a way to do that.</p>
  
  <p>here is my full code</p>
  
  <pre><code>  private void cusOkBtnActionPerformed(java.awt.event.ActionEvent evt) { 
  
      Double priceSec = Double.parseDouble(cusPrice2.getText());
      Double priceThird = Double.parseDouble(cusPrice3.getText());
      Double priceFourth = Double.parseDouble(cusPrice4.getText());
      Double priceFifth = Double.parseDouble(cusPrice5.getText());
  
      if(cusPrice2.getText()==null || cusPrice2.getText().isEmpty() || cusPrice2.getText() !=null ){
              priceSec=0.0;
              costCls.setItemPrice(priceSec);
              }
              else if(cusPrice3.getText()==null || cusPrice3.getText().isEmpty()){
              priceThird=0.0;
              }
              else if(cusPrice4.getText()==null || cusPrice4.getText().isEmpty()){
              priceFourth=0.0;
              }
              else if(cusPrice5.getText()==null || cusPrice5.getText().isEmpty()){
              priceFifth=0.0;
              }
  
             Double setItemTotal = priceCus+priceSec+priceThird+priceFourth+priceFifth;
  
  }
  </code></pre>