title: JPanels not showing up in Eclipse IDE?
body: <p>I'm a novice programmer, and I've been experimenting with GUI's lately. I've been working on an application on my school's computers (Windows XP, TextPad), and they compile and run fine on them. However, when I run the exact same code on my home computer (Mac OS Mountain Lion, Eclipse), the JPanel seems to not be added to the JFrame properly. I have the following classes.</p>
  
  <p>Main.java:</p>
  
  <pre><code>public class Main {
      public static void main( String[] args ) {
          new Frm();
      } // end of method main()
  } // end of class Main
  </code></pre>
  
  <p>Frm.java:</p>
  
  <pre><code>import javax.swing.JFrame;
  
  @SuppressWarnings("serial")
  public class Frm extends JFrame {
  
      private final int HEIGHT = 400;
      private final int WIDTH = 600;
  
      public Frm() {
          setSize(WIDTH, HEIGHT);
          setTitle("SHREK");  
          setVisible(true);
          setLocationRelativeTo(null);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          getContentPane().add(new Pnl());
      } // end of constructor
  
  } // end of class Frm
  </code></pre>
  
  <p>Pnl.java:</p>
  
  <pre><code>import java.awt.Color;
  import java.awt.Graphics;
  
  import java.awt.event.ActionListener;
  import java.awt.event.ActionEvent;
  
  import javax.swing.JPanel;
  import javax.swing.BorderFactory;
  
  @SuppressWarnings("serial")
  public class Pnl extends JPanel {
      public Pnl() {
          BorderFactory.createLineBorder(Color.BLACK, 5);
          setBackground(Color.BLACK); 
      } // end of constructor
  } // end of class Pnl
  </code></pre>