frame.dispose();
boolean disposed = false; while ( !disposed ) { try { frame.dispose(); disposed = true; } catch ( Throwable error ) { error.printStackTrace(); } }
    public void die() {        connected = false;        pump = null;                // shut down threads & sockets        try {            socket.close();            in.close();            out.close();        } catch (IOException e) {            e.printStackTrace();        } catch (NullPointerException e) {            // not a big deal, just never connected        }                frame.setVisible(false);        frame.dispose();                System.out.println("client: died");    }