[5832] in java-interest

home help back first fref pref prev next nref lref last post

What's wrong with this code ?

daemon@ATHENA.MIT.EDU (Pascal Robert)
Wed Feb 28 20:40:20 1996

Date: Wed, 28 Feb 1996 19:05:52 -0500
To: java-interest@java.sun.com
From: probert@Ergosoft.ergonet.com (Pascal Robert)

Hi,
   I am trying to code a little FTP client but my code doesn't work (Mac JDK):

-----------------------------------------------------------------------------
import java.applet.*;
import java.awt.*;
import java.net.*;

public class ftp extends Applet implements Runnable {

  Thread timer = null;
  URL site = new URL("ftp","ftp.microsoft.com",21,"*");
  URLConnection connection = new URLConnection(connection);
  try {connection.connect();} catch (IOException e){}
  try {connection.getInputStream();} catch (IOException e){}
  String file = connection.getFile();


  public void init() {
    resize(300,30);

  }

  public void paint(Graphics g)  {

  }

  public void start()  {
    if(timer == null)
    {
      timer = new Thread(this);
      timer.start();
    }
  }

  public void stop()  {
    timer = null;
  }

  public void run()  {
    while (timer != null)  {
      try {Thread.sleep(100);} catch (InterruptedException e){}
      repaint();
    }
  timer = null;
  }

  public void update(Graphics g)  {
    paint(g);
  }
}
-------------------------------------------------------------------------
What's wrong with this code ?  The problem is with the try{} method, the
compiler says that I forgot the type identifier.


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post