nachrichten.setContentType("text/html"); nachrichten.setText(htmlText); nachrichten.setFont(label9.getFont()); nachrichten.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e.getURL() != null) { String url = e.getURL().toString(); if (url.length() != 0) { executeLink(url);
final String htmlContent = htmlText; SwingUtilities.invokeLater(new Runnable(){ public void run(){ nachrichten.setContentType("text/html"); nachrichten.setText(htmlContent); nachrichten.setFont(label9.getFont()); nachrichten.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e.getURL() != null) { String url = e.getURL().toString(); if (url.length() != 0) { executeLink(url); } }
        public void run() {            if (logger.isEnabledFor(Level.DEBUG)) {                logger.debug("NachrichtenWorkerThread gestartet. " + this);            }            try {                String coreVersion = ApplejuiceFassade.getInstance().                    getCoreVersion().getVersion();                version.setText("<html>GUI: " +                                ApplejuiceFassade.GUI_VERSION +                                "<br>Core: " +                                coreVersion +                                "</html>");                String nachricht = "verwendeter Core: " + coreVersion;                if (logger.isEnabledFor(Level.INFO)) {                    logger.info(nachricht);                }                String htmlText = WebsiteContentLoader.getWebsiteContent(                    "http://www.applejuicenet.org", 80,                    "/inprog/news.php?version=" +                    ApplejuiceFassade.getInstance().getCoreVersion().                    getVersion());                int pos = htmlText.toLowerCase().indexOf("<html>");                if (pos != -1) {                    htmlText = htmlText.substring(pos);                }                else {                    htmlText = "<html>" + htmlText + "</html>";                }                StringBuffer buffer = new StringBuffer(htmlText);                int index;                while ( (index = buffer.indexOf(". ")) != -1) {                    buffer.replace(index, index + 1, ".<br>");                }                htmlText = buffer.toString();                nachrichten.setContentType("text/html");                nachrichten.setText(htmlText);                nachrichten.setFont(label9.getFont());                nachrichten.addHyperlinkListener(new HyperlinkListener() {                    public void hyperlinkUpdate(HyperlinkEvent e) {                        if (e.getEventType() ==                            HyperlinkEvent.EventType.ACTIVATED) {                            if (e.getURL() != null) {                                String url = e.getURL().toString();                                if (url.length() != 0) {                                    executeLink(url);                                }                            }                        }                    }                });            }            catch (Exception e) {                if (logger.isEnabledFor(Level.INFO)) {                    logger.info(                        "Versionsabhaengige Nachrichten konnten nicht geladen werden. Server down?");                }            }            if (logger.isEnabledFor(Level.DEBUG)) {                logger.debug("NachrichtenWorkerThread beendet. " + this);            }        }