import javax.swing.*;
import java.awt.Graphics;
import java.awt.*;
import java.awt.event.*;

public class AppletGrafik extends JApplet
{
 String isim;
 
 public void init()
 {
 isim=JOptionPane.showInputDialog("isminizi giriniz : ");
 }

 public void paint(Graphics g)
 {
 g.drawString("Java sınıfına Hoşgeldiniz " + isim,50,50);
 }
 
    public static void main(String s[])
    {
        JFrame f = new JFrame("AppletGrafik");
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        });
        JApplet applet = new AppletGrafik();
        f.getContentPane().add("Center", applet);
        applet.init();
        f.pack();
        f.setSize(new Dimension(800,400));
        f.setVisible(true);
    }
}

