Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

IP Finder


IP Finder in Java with Source Code: We can develop IP Finder in java with the help of Networking, AWT/Swing with event handling. Let’s see the code of creating IP Finder in java.

  1. String url=“www.Kreationnext.com”;
  2. InetAddress ia=InetAddress.getByName(url);
  3. String ip=ia.getHostAddress();

Let’s see the Swing code to find IP address.

  1. import javax.swing.*;
  2. import java.awt.event.*;
  3. import java.net.*;
  4. public class IPFinder extends JFrame implements ActionListener{
  5.     JLabel l;
  6.     JTextField tf;
  7.     JButton b;
  8. IPFinder(){
  9.     super(“IP Finder Tool – Kreationnext”);
  10.     l=new JLabel(“Enter URL:”);
  11.     l.setBounds(50,70,150,20);;
  12.     tf=new JTextField();
  13.     tf.setBounds(50,100,200,20);
  14.     b=new JButton(“Find IP”);
  15.     b.setBounds(50,150,80,30);
  16.     b.addActionListener(this);
  17.     add(l);
  18.     add(tf);
  19.     add(b);
  20.     setSize(300,300);
  21.     setLayout(null);
  22.     setVisible(true);
  23. }
  24. public void actionPerformed(ActionEvent e){
  25.     String url=tf.getText();
  26.     try {
  27.         InetAddress ia=InetAddress.getByName(url);
  28.         String ip=ia.getHostAddress();
  29.         JOptionPane.showMessageDialog(this,ip);
  30.     } catch (UnknownHostException e1) {
  31.         JOptionPane.showMessageDialog(this,e1.toString());
  32.     }
  33. }
  34. public static void main(String[] args) {
  35.     new IPFinder();
  36. }
  37. }

ip-finder

 

Comments

comments