JOptionPane.showMessageDialog(null, "An error occured while " + "reporting an error:\n" + uerrstr, "Error Reporting Error",
JTextArea jta = new JTextArea("An error occured while " + "reporting an error:\n" + uerrstr); jta.setEditable(false); JOptionPane.showMessageDialog(null, jta, "Error Reporting Error",
    private void sendError()    {        try        {            URL url = new URL("http://anyoneeb.ath.cx:83/jhack/reporterror");            URLConnection connection = url.openConnection();            connection.setDoOutput(true);            PrintWriter out = new PrintWriter(connection.getOutputStream());            out.print("version="                + URLEncoder.encode(MainGUI.getVersion(), "UTF-8"));            out.print("&outlog="                + URLEncoder.encode(JHack.out.getText(), "UTF-8"));            out.print("&errlog="                + URLEncoder.encode(JHack.err.getText(), "UTF-8"));            out.close();            BufferedReader in = new BufferedReader(new InputStreamReader(                connection.getInputStream()));            String inputLine;            StringBuffer input = new StringBuffer();            while ((inputLine = in.readLine()) != null)                input.append(inputLine).append('\n');            int il = input.length();            if (il > 0)                input.deleteCharAt(il - 1);            String instr = input.toString();            in.close();            try            {                int id = Integer.parseInt(instr);                einfodia = new JDialog(JHack.main.getMainWindow(),                    "Error Report", true);                JButton sendb = new JButton("Send"), nsendb = new JButton(                    "Don't Send");                sendi = true;                sendb.addActionListener(new ActionListener()                {                    public void actionPerformed(ActionEvent e)                    {                        sendi = true;                        einfodia.hide();                    }                });                nsendb.addActionListener(new ActionListener()                {                    public void actionPerformed(ActionEvent e)                    {                        sendi = false;                        einfodia.hide();                    }                });                JTextField usertf = new JTextField(20);                JTextArea comment = new JTextArea(5, 70);                einfodia.getContentPane().setLayout(new BorderLayout());                einfodia.getContentPane().add(                    HackModule.createFlowLayout(new JButton[]{sendb, nsendb}),                    BorderLayout.SOUTH);                Box entry = new Box(BoxLayout.Y_AXIS);                entry.add(HackModule.createFlowLayout(new JLabel(                    "An error has occured in JHack. "                        + "Please enter your username and any "                        + "information related to the error.",                    SwingConstants.CENTER)));                entry.add(HackModule.getLabeledComponent("Username: ", usertf));                entry.add(HackModule.getLabeledComponent("Comment: ", comment));                einfodia.getContentPane().add(entry, BorderLayout.CENTER);                einfodia.pack();                einfodia.show();                if (sendi)                {                    URL urlu = new URL(                        "http://anyoneeb.ath.cx:83/jhack/updateerror");                    URLConnection connectionu = urlu.openConnection();                    connectionu.setDoOutput(true);                    PrintWriter outu = new PrintWriter(connectionu                        .getOutputStream());                    outu.print("id="                        + URLEncoder.encode(Integer.toString(id), "UTF-8"));                    outu.print("&user="                        + URLEncoder.encode(usertf.getText(), "UTF-8"));                    outu.print("&comment="                        + URLEncoder.encode(comment.getText(), "UTF-8"));                    outu.close();                    BufferedReader inu = new BufferedReader(                        new InputStreamReader(connectionu.getInputStream()));                    input = new StringBuffer();                    while ((inputLine = inu.readLine()) != null)                        input.append(inputLine).append('\n');                    il = input.length();                    if (il > 0)                        input.deleteCharAt(il - 1);                    String uerrstr = input.toString();                    inu.close();                    if (uerrstr.trim().length() > 0)                    {                        JOptionPane.showMessageDialog(null,                            "An error occured while " + "reporting an error:\n"                                + uerrstr, "Error Reporting Error",                            JOptionPane.WARNING_MESSAGE);                    }                }            }            catch (NumberFormatException nfe)            {                JOptionPane.showMessageDialog(null, "An error occured while "                    + "reporting an error:\n" + instr, "Error Reporting Error",                    JOptionPane.WARNING_MESSAGE);                return;            }        }        catch (IOException ioe)        {            JOptionPane.showMessageDialog(null, "An error occured while "                + "reporting an error:\n" + ioe.getClass() + ": "                + ioe.getMessage(), "Error Reporting Error",                JOptionPane.WARNING_MESSAGE);            return;        }    }