+ private void error_html(String msg, String html) {
+ //System.err.println("===" + 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>";
+ //System.err.println("###" + whole_msg + "###");
+
+ JOptionPane.showMessageDialog(frame,whole_msg,"Error",JOptionPane.ERROR_MESSAGE);
+ }
+