import java.applet.*;
import java.awt.*;

public class PingsApplet extends Applet {

    private final String SERVER_HOSTNAME = "localhost";
    private final int SERVER_PORT = 6543;

    private PingsClient m_pings_client;

    public void init() {
        // Initialization (on page load).
        m_pings_client = new PingsClient(SERVER_HOSTNAME, SERVER_PORT);
        m_pings_client.start();
    }

    public void destroy() {
        // Don't leave the Pings client thread running!
        m_pings_client.interrupt();
    }

    public void paint(Graphics g) {
        // Draw applet here.
        g.setColor(Color.gray);
    }
}

@@ -6,20 +6,17 @@
 t java.a
-pple
+w
 t.*;%0Aimp
@@ -19,28 +19,31 @@
 %0Aimport java
-.awt
+x.swing
 .*;%0A%0Apublic 
@@ -68,16 +68,17 @@
 extends 
+J
 Applet %7B

Use Swing-enabled JApplet class as base class for our applet instead.