title: JFrame Issue: Syntax error on token "setDefaultCloseOperation"
body: <blockquote>
    <p>Error: <strong>Syntax error on token "setDefaultCloseOperation", Identifier
    expected after this token</strong></p>
  </blockquote>
  
  <p>Current Code:</p>
  
  <pre><code>package me.geekplaya.Launcher;
  
  import javax.swing.*;
  
  public class Launcher {
  
  //Create and setup the window.
  JFrame frame = new JFrame("Simple GUI");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
  JLabel textLabel = new JLabel("I'm a label in the window", SwingConstants.CENTER);
  textLabel.setPrefferedSize(new Dimension(300, 100));
  frame.getContentPane().add(textLabel, BorderLayout.CENTER);
  
  //Display the window.
  frame.setLocationRelativeTo(null);
  frame.pack();
  frame.setVisible(true);
  }
  </code></pre>