Drawing rectangles and oval
<p>First sorry if my question was asked before (i had search but couldn't find answer)
here is the question:
I wanna draw rectangle and oval when user type 1 or 2. I am programming with JAVA and here is my code. </p>

<pre><code>package shapes;
import java.awt.Graphics;
import javax.swing.JPanel;
public class shapes extends JPanel 
 {
    private int choise;
public shapes (int userchoise) 
{
choise=userchoise;
}
public void paintcomponent (Graphics g)
{
  super.paintComponent(g);
  for (int i=0; i&lt;=10; ++i)
{
switch (choise)
{
case 1 :
g.drawRect(10+i*10, 10+i*10, 50+i*10, 50+i*10);
break;
case 2:
g.drawOval(10+i*10, 10+i*10, 50+i*10, 50+i*10);
break;

        }
    }
}
}
</code></pre>

<p>this is the main class:</p>

<pre><code>package shapes;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class shapestest {

public static void main(String[] args) {
    // TODO Auto-generated method stub
    String input= JOptionPane.showInputDialog("Please enter 1"
            + " to drawing rectangel"+"Please enget 2 to drawing oval");
    int choise = Integer.parseInt(input);
    shapes myshape=new shapes (choise);
    JFrame application = new JFrame();
    application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    application.add(myshape);
    application.setSize(300, 300);
    application.setVisible(true);


}
}
</code></pre>

<p>The problem is I can't see anything when i run the program (after type 1 and 2)</p>

<p>How do I solve this problem?
....
Guys I finally found how to solve the problem (thanks to <a href="https://stackoverflow.com/users/2471439/kiheru">@kiheru</a></p>

<p>The only problem that this code have is just about case sensitive: <code>paintcomponent</code>  is not the same thing as <code>paintComponent</code>  <code>public void paintcomponent (Graphics g)</code>. So if you do this change, the code will work.</p>