import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.net.*;

class Pole extends JPanel implements ActionListener {
    JButton SendB;
	String hostAddr;
	JLabel Stat;		
	JTextArea Pisz;	
	
	Pole()
	{
	hostAddr="127.0.0.1";
  	  	   	 	
  	setSize(400, 300);
    setLocation(0, 0);
    setLayout(null);   	      
    setBackground(new Color(200,200,255));
    setForeground(Color.blue);  	    
    
    Pisz=new JTextArea("Podaj nick",30,20);
    Pisz.setFont(new Font("Arial CE",Font.PLAIN,16));
    Pisz.setSize(280, 200);
    Pisz.setLocation(20, 40);
    Pisz.setVisible(true);
    add(Pisz);
   
    SendB=new JButton("Wyślij");
    SendB.setBackground(Color.green);
    SendB.setForeground(Color.black);
    SendB.setSize(200, 25);
    SendB.setLocation(40, 260);
    SendB.addActionListener(this);
    SendB.setVisible(true);
    add(SendB); 
    
    Stat=new JLabel("Stat",Label.LEFT);    
    Stat.setFont(new Font("Verdana",Font.PLAIN,12)); 
    Stat.setBackground(new Color(192,192,192));
    Stat.setForeground(Color.black);
    Stat.setSize(400, 20);
    Stat.setLocation(0, 0);
    Stat.setVisible(true);    
    add(Stat);           
    setVisible(true);    
} 
//===============Akcja na naciskanie guzików======================= 
 public void actionPerformed (ActionEvent event) {
        Object target = event.getSource(); 
             if(target==SendB){
             	// Tutaj odpowiednia akcja   
             	Stat.setText("Nie mogę się połączyć ..."+hostAddr);            	           	            	
            }                            	    	    		    	    		               
  }
//==================================================================  
	
	
}
public class apklient extends JApplet{
		    	   	   
  public void init() 
  {
  	setContentPane(new Pole()); 
  } 
}
