- /**
- * Shows a dialog with the error <code>msg</code>.
- *
- * @param msg a String describing the error that occured.
- */
- private void error(String msg) {
- JOptionPane.showMessageDialog(frame,msg,"Error",JOptionPane.ERROR_MESSAGE);
- }
-
- private void error_html(String msg, String html) {
- Pattern body = Pattern.compile("<body>(.*)</body>",
- Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
- Matcher m = body.matcher(html);
- if (m.find()) {
- html = m.group(1);
- Pattern fixup = Pattern.compile("<(\\w+) */>");;
- m = fixup.matcher(html);
- html = m.replaceAll("<$1>");
- m = Pattern.compile("[\\r\\n]+").matcher(html);
- html = m.replaceAll(" ");
- }
- String whole_msg = "<html><h1>Error</h1>"+msg
- +"<h1>PCTB Server said:</h1><blockquote>"+html+"</blockquote>";
- if (dtxt!=null) dtxt.println("###" + whole_msg + "###");
-
- JOptionPane.showMessageDialog(frame,whole_msg,"Error",
- JOptionPane.ERROR_MESSAGE);
- }
-