title: Static class updates static variables, but static methods do not update static variables
body: <p>I searched through a few pages, but most seem to be just having comprehension issues as to what static means.The problem I have lies in that we are using a static class, FocusListener, and ActionListener. The class that has the event handling calls on the static class, and when a JTextfield is fill and tabbed away from FocusListener updates that static variable instantly. When all JTextfields are filled and FocusListener has updated the variables, there is a submit JButton. As soon as the button is clicked, the static methods are called to finish of any variables that are calculated using the previously updated variables. User is not aware of this. The variables do not update though, and I am curious if I am implementing this wrong? Thanks in advance.</p>
  
  <pre><code>import java.awt.*;
  import javax.swing.*;
  import java.awt.event.*;
  
  public class WellParameters extends JInternalFrame implements FocusListener, ActionListener {
      JLabel  measuredDepthL, ..., pitGainL, drillBitSizeL, 
                  mudInActivePitsL, mainPanelLabel;
          JTextField  measuredDepthT, ..., pitGainT, drillBitSizeT, mudInActivePitsT;
          JPanel  mainPanel, firstPanel, secondPanel, thirdPanel, fourthPanel, submitButtonPanel;
          JButton submitButton;
  
          WellParameters() {  
              super("Well Parameters", true, true, false, true);
              this.setBounds(0, 0, 600, 385);
              this.setVisible(true);
              this.setLayout(new BorderLayout());
  
              ...//GUI Stuff
  
              this.add(submitButtonPanel, BorderLayout.SOUTH);
          }
      @Override
      public void focusGained(FocusEvent e) {} //Ignore this!
  
      @Override
      public void focusLost(FocusEvent e) {
          try {
              if(e.getSource() == measuredDepthT) {
                  KillWellCalculations.measuredDepth = Integer.parseInt(measuredDepthT.getText());
  
                ...//Others 
  
              } else if(e.getSource() == mudInActivePitsT) {
                  KillWellCalculations.mudInActivePits = Double.parseDouble(mudInActivePitsT.getText());
              }
          } catch (Exception ignore) {}
  
      }
      @Override
      public void actionPerformed(ActionEvent e) {
          try {
              if(e.getSource() == submitButton) {
              System.out.println(KillWellCalculations.pumpEfficiency);
              KillWellCalculations.setPressureBeforeCasingBurstAndFormationFracture(); //Doesn't work
              KillWellCalculations.setCirculatingPressures();
              KillWellCalculations.setTriplexPumpCapacity();
              System.out.println(KillWellCalculations.mudInActivePits);
              System.out.println(KillWellCalculations.pumpFactor);
              System.out.println(KillWellCalculations.finalCirculatingPressure);}
          }
          catch(Exception ignore) {}
      }
  }
  </code></pre>
  
  <p>That was the GUI, and this is the static class... They are 2 separate classes. Not in the same file.
  package killwellsheet;</p>
  
  <pre><code>public class KillWellCalculations {
  
      static int measuredDepth;           //Total Depth from open hole to bottom
  
          ... //Tons of other variables
  
      static double totalStrokes;         //add strokes
  
      //Used to set different circulating pressures for the well
      public static void setCirculatingPressures() {
          initialCirculatingPressure = circulatingPressureKillRate + shutInDrillPipePressure;
          finalCirculatingPressure = circulatingPressureKillRate * (killMudWeight/currentMudWeight);
      }   
      //Calculates capacity of anypipe
      private static double pipeCapacity(double length, double insideDiameter) {
          return length * ((insideDiameter*insideDiameter)/1029.4);
      }
      //Calculates capacity of the annulus/open hole
      private static double annulusCapacity(double length, double insideDiameter, double outsideDiameter) {
          return length * (((insideDiameter*insideDiameter)-(outsideDiameter*outsideDiameter))/1029.4);
      } 
  
           ... //Other functions
  
      //Set the casing burst pressure
      public static void setPressureBeforeCasingBurstAndFormationFracture() {
          beforeCasingBurst = burstPressure*0.70;
          beforeFormationFracture = (0.052*casingShoeDepth)*(fracGradientMWEquivalent - currentMudWeight);
      }
      public static void bariteNeedAndVolumeIncrease() {
          bariteSacksRequired = (totalMudVolume/100)*((1099*(killMudWeight-currentMudWeight))/(28.35-killMudWeight));
          increaseInMudVolume = 0.091*bariteSacksRequired;
      }
      public static void pumpStrokes() {
          surfaceToBit = (mudInDrillString)/pumpFactor;
          bitToSurface = (mudInAnnulus)/pumpFactor;
          totalStrokes = surfaceToBit + bitToSurface;
      }
  }//end class
  </code></pre>