title: Linking GUI to Main in Java
body: <p>I'm very new to Java and OOP in general and I want to call my GUI class from my Main class which will be the start point for my program. </p>
  
  <p>This should be pretty simple but any help will be appreciated </p>
  
  <p>GUIForm1 Code:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  
  public class GUIForm1 {
  
  private JPanel MainPanel;
  private JPanel MenuPanel;
  Private JPanel AnimationPanel;
  private JButton greenTrail;
  private JButton purpleTrail;
  private JSeparator animationMenuDivider;
  private JSlider rangeSlider;
  //more components
  
  public GUIForm1() {
  
  
     JFrame frame = new JFrame("GUIForm1");
      frame.setContentPane(new GUIForm1().MainPanel);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setExtendedState(Frame.MAXIMIZED_BOTH);
      frame.pack();
      frame.setVisible(true);
  
     }
  }
  </code></pre>
  
  <p>Main Class Code:</p>
  
  <pre><code>public class ProjectileSim {
  
  public static void main(String[] args){
      GUIForm1 gui = new GUIForm1();
  
  }
  }
  </code></pre>