由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Re: How can I get localhost's address in a Applet?
相关主题
why it does not work?? :(((再问个java的蠢问题,别骂我
新手请教 java applet+html 入门级问题愣是笨到家----整不明白applet的path
Help-applet access remote database为什么我这个html找不到applet class?
Help: UnknownHostExceptionreturn null or empty list/set/...
how can I test own local IP address对 spring 的 exception 处理方式真是不适应
Re: How to write to a file on server in an applet?问一个 java generic问题
a question regarding appletJava 1-to-1 chat program
赶快帮帮我!Run Servlet with Tomcat
相关话题的讨论汇总
话题: applet话题: localhost话题: ip话题: public话题: import
进入Java版参与讨论
1 (共1页)
c*******c
发帖数: 7
1
SORRY I don't mention you are using an applet.
you can try this:
import java.net.*;
import java.applet.Applet;
import java.awt.Graphics;
public class AppletIp extends Applet{
public void AppletIp() {};
public void paint(Graphics g) {
InetAddress host=null;
try {host=InetAddress.getLocalHost();
} catch (Exception e) {}
String ip=host.getHostAddress();
System.out.print("IP: "+ip);
showStatus(ip);
}
public static void main (String argv[]) throws Exception
{
}
}
it ca
1 (共1页)
进入Java版参与讨论
相关主题
Run Servlet with Tomcathow can I test own local IP address
急问:TOMCAT1.4.1+iis如何配置?Re: How to write to a file on server in an applet?
How to compute round-trip time to websera question regarding applet
How to connect to SQL2000?赶快帮帮我!
why it does not work?? :(((再问个java的蠢问题,别骂我
新手请教 java applet+html 入门级问题愣是笨到家----整不明白applet的path
Help-applet access remote database为什么我这个html找不到applet class?
Help: UnknownHostExceptionreturn null or empty list/set/...
相关话题的讨论汇总
话题: applet话题: localhost话题: ip话题: public话题: import