title: StackOverflowError No idea what is wrong
body: <p>I'm continuously receiving this error when trying to run my program. </p>
  
  <pre><code>Exception in thread "main" java.lang.StackOverflowError
  
  at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
  at javax.swing.UIDefaults.getUI(UIDefaults.java:752)
  at javax.swing.UIManager.getUI(UIManager.java:1001)
  at javax.swing.JPanel.updateUI(JPanel.java:109)
  at javax.swing.JPanel.&lt;init&gt;(JPanel.java:69)
  at javax.swing.JPanel.&lt;init&gt;(JPanel.java:92)
  at javax.swing.JPanel.&lt;init&gt;(JPanel.java:100)
  at serverProperties.&lt;init&gt;(serverProperties.java:164)
  at exportProperties.&lt;init&gt;(exportProperties.java:8)
  at serverProperties.&lt;init&gt;(serverProperties.java:162)
  </code></pre>
  
  <p>It only happens after trying to access a method from a certain class.</p>
  
  <p>This is the main class:</p>
  
  <pre><code>public class serverProperties extends JPanel
  {
      //Add classes
      exportProperties writeProperties = new exportProperties();
  
      //Assume I created the array sent to the exportProperties class
  
      public serverProperties()
      {
          CheckBoxListener checkListener = new CheckBoxListener();
  
          //Assume I created the check box and added the listener for it
      }
  
  
      private class CheckBoxListener implements ItemListener
      {
  
          public void itemStateChanged (ItemEvent event)
          {
              JCheckBox checkBox;
              checkBox= (JCheckBox)event.getSource();
  
              //Process check Boxes
              if (checkBox.isSelected())
              {
                  checkBox.setText("Yes");
                  writeProperties.exportFile(propertiesArr);
              }
          }
      }
  }
  </code></pre>
  
  <p>This is the code for the class accessed by the code above:</p>
  
  <pre><code>public class exportProperties extends serverProperties
  {
  
  
      public void exportProperties(String[] args)
      {
          exportFile(args);
      }
  
      public static void exportFile(String[] propertiesArr)
      {
          try
          {
              FileWriter outFile = new FileWriter("Path/file.txt");
              BufferedWriter out = new BufferedWriter(outFile);
  
              //Loop through properties
              for (int i=0; i &lt; 27; i++)
              {
                  out.append(propertiesArr[i]);
              }
              //out.write("Test");
              out.close();
  
          }
          catch (IOException exception)
          {
              exception.printStackTrace();
          }
      }
  
      public void importFile()
      {
  
      }
  
  
  }
  </code></pre>
  
  <p>Once I remove the call to the exportProperties class the program work perfectly. 
  With the error message, the last two lines</p>
  
  <pre><code>at exportProperties.&lt;init&gt;(exportProperties.java:8)
  at serverProperties.&lt;init&gt;(serverProperties.java:162)
  </code></pre>
  
  <p>they repeat MANY times before it just ends. </p>
  
  <p>I've googled, and googled, I've got no idea what is going on..
  I appreciate the help!</p>