

package swin;
import java.awt.event.*;
import java.net.UnknownHostException;
import javax.swing.*;
public class Swin {
private int x1,x2,x3;
Swin()
{
JFrame F=new JFrame(“it-solutions.center”);
JButton B=new JButton(“IP view”);
JTextField tf=new JTextField();
JLabel L=new JLabel();
B.setBounds(150,150,100, 40);
tf.setBounds(50,50, 150,20);
L.setBounds(100, 60, 300, 30);
F.add(B);
F.add(L);
F.add(tf);
F.setLayout(null);
F.setSize(400,400);
F.setVisible(true);
F.setResizable(false);
B.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
try{
String host=tf.getText();
String ip=java.net.InetAddress.getByName(host).getHostAddress();
L.setText( “the ip of website”+host+”is” + ip );
// L.setText(“IP of “+host+” is: “+ip);
}catch(UnknownHostException ex){System.out.println(ex);}
}
});
}
public static void main(String[] args) {
Swin ob= new Swin();
}
}