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

public class  welcomeP extends JPanel implements ActionListener
{ 
  JLabel label1;
  JTextField namebox;
  JPanel inputPanel;
  JTextArea t;
  String name;
  
  public welcomeP()
  {    	
    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); }
  repaint();
  }

}
