title: How to create a canvas inside JFrame and draw a few basic shapes?
body: <p>I am new to java and created my own window frame. Now i just need to draw few graphics shapes into it.</p>
  
  <pre><code>import javax.swing.JFrame;
  
  public class run {
  
  public static void main(String[] args) {
  
      JFrame frame = new JFrame();
  
  int resx = 400,resy = 400;
  
  frame.setSize(resx,resy);
  frame.setLocationRelativeTo(null);
  frame.setTitle("Mover");
  frame.setResizable(false);
  frame.setVisible(true);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
  
  }
  }
  </code></pre>