title: Creating a Bar graph on JPanel
body: <p>Can anyone tell me what is wrong with this? I'm pretty new to Java and I can't seem to get why this won't open the <code>JPanel</code> or the rectangles, or the strings. Nothing is being shown but it does compile.</p>
  
  <p>Code:</p>
  
  <pre><code>import java.awt.*;
  import javax.swing.*;
  
  public class Graphing extends JPanel
  {
  
     public static void main (String[] args)
     {
     }
  
     public Graphing()
     {
        JFrame frame = new JFrame ("Nested Panels");
        frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
  
        frame.getContentPane();
        frame.setPreferredSize(new Dimension(350,200));
        frame.pack();
        frame.setVisible(true);
     }
  
     public void paintComponent (Graphics page)
     {            
        super.paintComponent (page);          
        final int HEIGHT = 10;
  
        page.setColor (Color.yellow);
        page.fillRect (50, 50, (7*10), HEIGHT);//1-10
        page.fillRect (50, 64, (5*10), HEIGHT);//11-20
        page.fillRect (50, 78, (0*10), HEIGHT);//21-30
        page.fillRect (50, 92, (1*10), HEIGHT);//31-40
        page.fillRect (50, 106, (9*10), HEIGHT);//41-50
        page.fillRect (50, 120, (12*10), HEIGHT);//51-60
        page.fillRect (50, 134, (4*10), HEIGHT);//61-70
        page.fillRect (50, 148, (6*10), HEIGHT);//71-80
        page.fillRect (50, 162, (2*10), HEIGHT);//81-90
        page.fillRect (50, 176, (13*10), HEIGHT);//91-100
  
        page.drawString("1-10",10,60);
        page.drawString("11-20",10,74);
        page.drawString("21-30",10,88);
        page.drawString("31-40",10,102);
        page.drawString("41-50",10,116);
        page.drawString("51-60",10,130);
        page.drawString("61-70",10,144);
        page.drawString("71-80",10,158);
        page.drawString("81-90",10,172);
        page.drawString("91-100",10,186);
  
        page.drawString("7", 30, 60);
        page.drawString("5", 30, 74);
        page.drawString("0", 30, 88);
        page.drawString("1", 30, 102);
        page.drawString("9", 30, 116);
        page.drawString("12", 30, 130);
        page.drawString("4", 30, 144);
        page.drawString("6", 30, 158);
        page.drawString("2", 30, 172);
        page.drawString("13", 30, 186);
     }
  
  }
  </code></pre>