title: JLabel orientation causes error
body: <p>I am new to Java Swing. i cretaed a simple JFrame as shown below in the code, but when the line <code>statusLabel = new JLabel("statusLabel", JLabel.WEST);</code> is there i receive the below posted errors at run time, and when i comment that line out, the JFrame appears.</p>
  
  <p>please let me know why this line <code>statusLabel = new JLabel("statusLabel", JLabel.WEST);</code> causes error.</p>
  
  <pre><code>public GUI() {
      // TODO Auto-generated constructor stub
      prepareGUI();
  }
  private void prepareGUI() {
      // TODO Auto-generated method stub
      mainFrame = new JFrame("Swing Example");
      mainFrame.setSize(400, 400);
  
      headerLabel = new JLabel("headerLabel", JLabel.CENTER);
      statusLabel = new JLabel("statusLabel", JLabel.WEST);//this line when it is exist, causes errors
  
      mainFrame.add(headerLabel);
      mainFrame.add(statusLabel);
      mainFrame.setVisible(true);
  }
  
  public static void main(String[] args) {
      GUI gui = new GUI();
  }
  </code></pre>
  
  <p><strong>error</strong>:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: horizontalAlignment
  at javax.swing.JLabel.checkHorizontalKey(Unknown Source)
  at javax.swing.JLabel.setHorizontalAlignment(Unknown Source)
  at javax.swing.JLabel.&lt;init&gt;(Unknown Source)
  at javax.swing.JLabel.&lt;init&gt;(Unknown Source)
  at test.GUI.prepareGUI(GUI.java:23)
  at test.GUI.&lt;init&gt;(GUI.java:15)
  at test.GUI.main(GUI.java:31)
  </code></pre>
  
  <p><strong>Update</strong>:</p>
  
  <p>now after using .LEFT instead, the text that suppose to be placed at the .CENTER disappeared. why that is happening</p>