home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-03-09 | 787 b | 29 lines |
- // Used to get the user name. special crdits to Robert Scott at the
-
-
- // Java message base for the tech part and Mig9 for the motivation part.
-
-
- // Amit C. (ConnectSoft Ruksun, Pune, India) amit@maverick.corus.co.in
-
-
-
-
-
- import java.applet.Applet;
-
-
- import java.awt.Graphics;
-
-
- import java.net.InetAddress;
-
-
- import java.net.UnknownHostException;
-
-
-
-
-
- public class urname extends Applet
-
-
- {
-
-
- InetAddress myAddress= null;
-
-
-
-
-
- public void init()
-
-
- {
-
-
- try
-
-
- {
-
-
- myAddress = InetAddress.getLocalHost();
-
-
- }
-
-
- catch(UnknownHostException e){}
-
-
- }
-
-
- public void paint(Graphics g)
-
-
- {
-
-
- g.drawString("Welcome " + myAddress.getHostName() +"!", 10, 20);
-
-
- // g.drawString(myAddress.toString(), 10, 20);
-
-
- }
-
-
-
-
-
- }
-
-
-