Auf Thema antworten

Hallo Leute,


ich habe folgenden code:


[code=Java]

import java.applet.Applet;

import java.io.DataInputStream;

import java.io.IOException;

import java.net.ServerSocket;

import java.net.Socket;


import javax.swing.JTextField;


public class Test extends Applet {

   

    JTextField txt;

    DataInputStream is;

    ServerSocket ss;

    Socket s;

   

    public static void main(String[] args) {

        new Test();

    }

   

    public void init () {

        txt = new JTextField("waiting for connection...");

        add(txt);

       

        try {

            setup();

        } catch (IOException e) {

            e.printStackTrace();

        }

    }

   

    public void setup () throws IOException {       

        try {

            ss = new ServerSocket(8080);

        } catch ( IOException e ) {

        }

       

        try {

            s = ss.accept();

        } catch ( IOException e ) {

        }

    }


}

[/code]


wenn ich den code in eclipse nun als Applet ausführe steht nur da "Applet geladen" , jedoch nicht "Applet gestartet".


Außerdem wird mir auch mein TextFeld nicht angezeigt.


Was mach ich falsch?


Danke im Voraus.


mfg tom



Oben