title: Java awt Swing - Did I encounter a Bug?
body: <p>I have no run-time error but the problem is obvious.</p>
  
  <p>When I code <strong>g.drawString ("message",45,45);</strong> it outputs this when I run the program. If you cannot see basically the window 'prt screened' my current screen with the g.drawString in the correct position.</p>
  
  <p>NOTE: method paint over-rides <em>java.awt.Window.paint</em></p>
  
  <p><img src="https://i.stack.imgur.com/82BS2.png" alt="enter image description here"></p>
  
  <pre><code>import java.awt.Graphics;
  import javax.swing.JFrame;
  
  
  public class test extends JFrame{
  
   public test (){
  
           setSize(800, 600);
           setVisible(true); 
           setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           setTitle("PlotGraph");
      }
       public void paint(Graphics g){
  
           g.drawString("Click the mouse inside the window.",40,45); // draw a string
       }
  
      public static void main(String[] args) {
  
          new test();
      }
  
  }
  </code></pre>