import javax.swing.*;
import java.awt.*;

public class PaintOutput {
    
    public static void main(String[] args) {
      NewFrame frame=new NewFrame();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.show();
    }
  
 static class NewFrame extends JFrame
 {
    public NewFrame()
      {
        setTitle("NotHelloWorld"); 
        setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
        //add panel to frame
        NewPanel panel=new NewPanel();
       
        Container contentPane=getContentPane();
        contentPane.add(panel);
        }
  public static final int DEFAULT_WIDTH=600;
  public static final int DEFAULT_HEIGHT=400;
  }
 
 static class NewPanel extends JPanel
 {
   public void paintComponent (Graphics g)
     {
       super.paintComponent(g);
       g.drawString("Hello", 75,100);
       
      }
  }  
 
}


