title: JLabel not Centering
body: <p>So I have been working on a java program an i am trying to get the JLabel centered in the middle of the window, but what ever I do the label is only at the top center. I am hoping someone can help find a way to get the text centered in the middle of the window. Here is my code:</p>
  
  <pre><code>import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  import javax.swing.JFrame;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import javax.swing.JTextField;
  import javax.swing.SwingConstants;
  import javax.swing.SwingUtilities;
  
  public class Lottery extends JPanel implements ActionListener {
  
  
      private static final long serialVersionUID = 5815877011755522230L;
  
      private JLabel label;
  
      public static void main(String[] args) {    
          make();
  
      }
  
      public Lottery() {
  
          label = new JLabel("Hello There");
          label.setHorizontalAlignment(JLabel.CENTER);
          label.setVerticalAlignment(JLabel.CENTER); 
          add(label);
  
      }
  
      public static void make(){
          JFrame frame = new JFrame("Lottery");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          Lottery hi = new Lottery();
          frame.setContentPane(hi);
  
          frame.setSize(600, 600);
          frame.setVisible(true);
  
      }
  
  
  }
  </code></pre>
  
  <p>Can someone please help me solve this issue.</p>