import java.applet.*; import java.awt.*; import java.net.*; public class marquee extends Applet implements Runnable { InetAddress myAddress= null; int x=0; int y=0; int width=0; Thread my_thread = null; public void init() { Font font; font = new Font("Helvitica",2,15); Color col; col = new Color(255,255,255); setBackground(Color.blue); setForeground(col); try { myAddress = InetAddress.getLocalHost(); } catch(UnknownHostException e){} x=size().width; y=size().height; width=x; } public void paint(Graphics g) { g.drawString("Mahes Ram Ganesan welcomes " + myAddress.getHostName() +"!", x,y); } public void start() { my_thread = new Thread(this); my_thread.start(); } public void run() { while (true) { repaint(); x -= 3; if (x<-200) x=width; try { Thread.sleep(200); } catch (InterruptedException e) { stop(); } } } }