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

public class  welcomeA extends JApplet implements ActionListener
{ 
  JLabel label1;
  JTextField namebox;
  JPanel inputPanel;
  JTextArea t;
  String name;

 
  public void init()
  {    
	label1=new JLabel("enter your name : ");
	t=new JTextArea(" ");
	t.setFont(new Font("Serif",Font.BOLD,24));
	namebox=new JTextField("                                       ");	
    setLayout(new BorderLayout());
    inputPanel=new JPanel();
    inputPanel.add(label1);
    inputPanel.add(namebox);
    add(inputPanel,BorderLayout.NORTH);
    add(t,BorderLayout.CENTER);
    namebox.addActionListener(this);
  }
  
public void actionPerformed( ActionEvent e)
{
	 if(e.getSource()==namebox)
        {   name=namebox.getText();
	        t.setText("Welcome to java graphic programming environment "+name); }
}

    public static void main(String s[])
    {
        JFrame f = new JFrame("Welcome to java graphic programming environment Applet Graphic");
        f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        JApplet applet = new welcomeA();
        f.getContentPane().add("Center", applet);
        applet.init();
        f.setSize(800,500);
        f.setVisible(true); 
    }  
}
