runnign through a proxy
import jav.net.*;
import java.io.*;
import java.util.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
publicclass inetextends JFrameimplements ActionListener
{
public JButton ok;
public JTextField host, ip;
public JPanel prim;
public JLabel ho, i;
public inet()
{
ok =new JButton("find ip");
host =new JTextField(15);
ip =new JTextField(15);
ho =new JLabel("host");
i =new JLabel("ip address");
ip.setEditable(false);
prim =new JPanel();
ok.addActionListener(this);
prim.add(ho);
prim.add(host);
prim.add(ok);
prim.add(i);
prim.add(ip);
}
public JPanel getPrim()
{
return prim;
}
publicvoid actionPerformed(ActionEvent e)
{
if(e.getSource() == ok)
{
try
{
String add = host.getText();
get(add);
}
catch(IOException io)
{
JOptionPane.showMessageDialog(null,"error");
}
}
}
publicvoid get(String a)throws IOException
{
try
{
InetAddress remote = InetAddress.getByName(a);
//System.out.println(remote.getHostName());
//System.out.println(remote.getHostAddress());
ip.setText(remote.getHostAddress());
}
catch(UnknownHostException uhe)
{
JOptionPane.showMessageDialog(null,"could not find host");
}
}
}
as you an see, I have written a very simple program to find the ip of the host specefied.
I am trying to expand my knowlage of programming with net and io, and I came accross the question. What If I wanted to run this app on a machine that runs through a local proxy server.
My question to you is this. Is there a way to impliment the InetAddress commands to run through a local proxy, or maybe another class I could impliment to achieve this goal.
thanks in advance for any and all help.

