title: Eclipse WindowBuilder / Jframe - Update labels text
body: <p>Hi im working on a program that will run through a list of programs and open them.
  in order for this to look nice i need to change the text in a label to match the programs name. how ever when i call the ChnageTitle and Refresh funtions they do not appear to work. can you please help point out where i am going wrong?</p>
  
  <p>here is the main auto generated window builder code i edited it slightly and added  </p>
  
  <pre><code>    package WindowBuilder;
  
  import java.awt.EventQueue;
  
  import javax.swing.JFrame;
  import javax.swing.JButton;
  import java.awt.BorderLayout;
  import java.awt.event.ActionListener;
  import java.awt.event.ActionEvent;
  import javax.swing.SwingConstants;
  
  import Logic.ButtonPresses;
  import javax.swing.JTextField;
  import javax.swing.JLabel;
  
  public class WindowBuilder {
      public JLabel Title;
      private JFrame frame;
  
      /**
       * Launch the application.
       */
      public void Launch() {
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      WindowBuilder window = new WindowBuilder();
                      window.frame.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  
      /**
       * Create the application.
       */
      public WindowBuilder() {
          initialize();
      }
  
      /**
       * Initialize the contents of the frame.
       */
      public void Refresh(){
          frame.revalidate();
          frame.repaint();
      }
      public void ChangeTitle(){
          Title.setText("Test");
      }
      public void initialize() {
          frame = new JFrame();
          frame.setResizable(false);
          frame.setBounds(100, 100, 450, 300);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          JButton btnNext = new JButton("Next");
          btnNext.setBounds(365, 226, 79, 45);
          btnNext.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                  ButtonPresses.Next();
              }
          });
          frame.getContentPane().setLayout(null);
          frame.getContentPane().add(btnNext);
  
          JButton btnBack = new JButton("Back");
          btnBack.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  ButtonPresses.Back();
              }
          });
          btnBack.setBounds(0, 226, 79, 45);
          frame.getContentPane().add(btnBack);
  
          Title = new JLabel("Program Name");
          Title.setBounds(9, 11, 89, 33);
          frame.getContentPane().add(Title);
  
          JButton btnInstall = new JButton("Install/Run");
          btnInstall.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
              }
          });
          btnInstall.setBounds(173, 226, 116, 45);
          frame.getContentPane().add(btnInstall);
      }
  
  }
  </code></pre>
  
  <p>here is where i am calling the functions. </p>
  
  <pre><code>    package Main;
  
  import Logic.ProgramAdder;
  import Logic.Programs;
  import WindowBuilder.WindowBuilder;
  
  public class Main {
  
      public static void main(String[] args) {
          Main start = new Main();
          start.Start();
      }
      public void Start(){
          WindowBuilder wb = new WindowBuilder();
          wb.Launch();
          ProgramAdder.ProgramList();
          DisplayPrograms();
          wb.ChangeTitle();
          wb.Refresh();
      }
      public static void DisplayPrograms(){
          for (Programs p : ProgramAdder.programs) {
                 System.out.print(p.ProgramName);
                 System.out.println(p.ProgramPath);
          } 
      }
  
  }
  </code></pre>