2 Launch4j (http://launch4j.sourceforge.net/)
3 Cross-platform Java application wrapper for creating Windows native executables.
5 Copyright (C) 2004, 2006 Grzegorz Kowal
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 * Created on May 12, 2005
25 package net.sf.launch4j;
27 import javax.swing.JTextArea;
28 import javax.swing.SwingUtilities;
31 * @author Copyright (C) 2005 Grzegorz Kowal
33 public abstract class Log {
34 private static final Log _consoleLog = new ConsoleLog();
35 private static final Log _antLog = new AntLog();
37 public abstract void clear();
38 public abstract void append(String line);
40 public static Log getConsoleLog() {
44 public static Log getAntLog() {
48 public static Log getSwingLog(JTextArea textArea) {
49 return new SwingLog(textArea);
53 class ConsoleLog extends Log {
55 System.out.println("\n");
58 public void append(String line) {
59 System.out.println("launch4j: " + line);
63 class AntLog extends Log {
65 System.out.println("\n");
68 public void append(String line) {
69 System.out.println(line);
73 class SwingLog extends Log {
74 private final JTextArea _textArea;
76 public SwingLog(JTextArea textArea) {
81 SwingUtilities.invokeLater(new Runnable() {
83 _textArea.setText("");
87 public void append(final String line) {
88 SwingUtilities.invokeLater(new Runnable() {
90 _textArea.append(line + "\n");