title: Reading data from another file in a project
body: <p>I  got stuck in an issue that I am sure is easy to overcome. The main class is used to build a gui:</p>
  
  <p>// AlladinLamp.java</p>
  
  <pre><code>package alladinlamp;
  
  
  import javax.swing.table.*; 
  import javax.swing.*; 
  import java.awt.*;
  
  class AlladinLamp  {
  
  int fnh;
  ComboBox runners;
  
  [ ...code ]
  
  AlladinLamp()  {
  
  [ ...code ]
  
  runners = new JComboBox( numberOfRunners );
         runners.setMaximumRowCount(5); 
         runners.addActionListener( new ActionListener() {   
            @Override
            public void actionPerformed( ActionEvent e ) {
               String  runnersNumber = ( String )runners.getSelectedItem();
               fnh = Integer.parseInt( runnersNumber ); 
  }
  
  [ ...code ]
  
  public int getFNH() { return fnh; }
  
  [ ...code ]
  
  SwingUtilities.invokeLater( new Runnable()  {
              @Override
              public void run()  {
                  AlladinLamp lamp = new AlladinLamp();                 
              }
          });
  
  }
  </code></pre>
  
  <p>I want to be able to read fnh from another file</p>
  
  <pre><code>package alladinlamp; 
  
  Class Processes  {
  
     int fullNH;
     AlladinLamp lamp;
  
  
  
     Processes()  {
        lamp = new AlladinLamp();
        fullNH = lamp.getFNH();
  
  [ ...code ]
  
  }
  
  [ ...code ]
  
  }
  </code></pre>
  
  <p>But it´s not happening ( fnh = null ). The integer is read in the same file it was created though. What am I doing wrong? Any help would be greatly appreciated.</p>