Exemplo n.º 1
0
 private void addHTML(String html) {
   synchronized (kit) {
     try {
       kit.insertHTML(doc, doc.getLength(), html, 0, 0, null);
     } catch (BadLocationException | IOException ignored) {
       Logger.logError(ignored.getMessage(), ignored);
     }
     displayArea.setCaretPosition(displayArea.getDocument().getLength());
   }
 }
Exemplo n.º 2
0
  private void createUIComponents() {
    displayArea = new JEditorPane("text/html", "");
    displayArea.setEditable(false);
    kit = new HTMLEditorKit();
    displayArea.setEditorKit(kit);

    JScrollPane scrollPane = new JScrollPane(displayArea);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

    logType = ELogType.valueOf(SettingsUtils.getValue(ESetting.LOGTYPE));
    refreshLogs();
    Logger.addListener(this);

    System.setOut(new OutputOverride(System.out, LogLevel.INFO));
    System.setErr(new OutputOverride(System.err, LogLevel.ERROR));
    try {
      Logger.addListener(new LogWriter(new File(launcherLogFile)));
    } catch (IOException e1) {
      Logger.logError(e1.getMessage(), e1);
    }
  }