title: JTextField to display string from another class
body: <p>I have a minor issue:  My first class which for example prints out a string called "average". The string average says "hello".</p>
  
  <p>for example:</p>
  
  <pre><code>package downloadpage;
  
  public class DownLoadPage {
  
  public void main(String[] args) throws IOException {
    string average;
    average = "hello";
    System.out.print(average);
  </code></pre>
  
  <p>My second class app.java which displays a text field.</p>
  
  <pre><code>package downloadpage;
  
  public class app {
  
  private JFrame frame;
  JTextField textField1;
  
  /**
   * Launch the application.
   */
  public static void main(String[] args) {
      EventQueue.invokeLater(new Runnable() {
          public void run() {
              try {
                  app window = new app();
                  window.frame.setVisible(true);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      });
  }
  
  /**
   * Create the application.
   */
  public app() {
      initialize();
  }
  
  
  /**
   * 
   * Initialize the contents of the frame.
   */
  private void initialize() {
      frame = new JFrame();
      frame.setBounds(100, 100, 450, 300);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      textField1 = new JTextField();
  
      frame.getContentPane().add(textField1, BorderLayout.NORTH);
      textField1.setColumns(10);
  }
  }
  </code></pre>
  
  <p>How would can I get it when I run <code>app.java</code> to have <code>textField1</code> to display data from <code>"string average"</code> in <code>downloadpage.java</code>?</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Also, when I run <code>app.java</code> how do I set it to run <code>downloadpage.java</code> first to get the information for average? This way when <code>app.java</code> runs its able to have the proper data as the data is only generated once <code>downloadpage.java</code> runs?</p>