title: paint() in java with no display
body: <pre><code>import java.util.*;
  import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  import java.awt.geom.*;
  
  
  
  
  class game extends JFrame {
      public game(){   //this is constructor
          JFrame frame  = new JFrame();
          frame.setVisible(true);
          frame.setSize(500,500);
          frame.setTitle("Hello world");
      }
  
      public void paint(Graphics g){
          Graphics2D g2 = (Graphics2D) g;
          Line2D line = new Line2D.Double(60,90,150,100);
          g2.draw(line);
  
  
      }
  
  
      public static void main(String args[]) {
  
          game l = new game();
  
      }
  
  
  }
  </code></pre>
  
  <p>The above code is compiling in java but on running the code it only displays the frame and its title, but does not include any of the lines being drawn using the Graphics2D and Line2D, what is the mistake that is being made??? The frame being displayed does not show any content, why is that???</p>