public void close() {
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                try {
                    writer.close();
                    writer2.close();
                    reader.close();
                    reader2.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

        });
    }