title: JLabel does not align the text in the center
body: <p>Is there anything wrong in this code?</p>
  
  <pre><code>JFrame frame = new JFrame();
  JPanel panel = new JPanel();
  panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
  JLabel lab = new JLabel();
  lab.setHorizontalAlignment(SwingConstants.CENTER);
  lab.setText("TESET");
  panel.add(lab);
  frame.getContentPane().add(BorderLayout.NORTH,panel);
  frame.setVisible(true);
  frame.pack();
  </code></pre>