
// Project: webCDwriter - Network CD Writing
// Author: Jörg Haeger, 10.08.2000

import javax.swing.*;

public class Log
{
	private static JTextArea textArea = new JTextArea();
	private static JScrollPane scrollPane = init();

	public static void clear()
	{
		textArea.setText("");
	}

	public static JComponent getView()
	{
		return scrollPane;
	}

	private static JScrollPane init()
	{
		scrollPane = new JScrollPane(textArea);
		scrollPane.setHorizontalScrollBarPolicy(
			JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
		return scrollPane;
	}

	public static void put(String str)
	{
		textArea.append(str + "\n");
		JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
		scrollBar.setValue(scrollBar.getMaximum());
	}
}

