Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / Java / Java SE

Free "tail -f" Tool for all Platforms: Tail for Windows, Tail for Linux and Tail for Mac

Rate me:
Please Sign up or sign in to vote.
2.08/5 (8 votes)
19 Jul 2006CPOL3 min read 55.9K   1.1K   24  
MakeLogic Tail is a freeware similar to " tail -f " of Linux. It is Tail for Windows, Tail for Linux and Tail for Mac
/******************************************************************************
 
Copyright (C) 2006  MakeLogic

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


Date		: 14th April 2006
Authors		: MakeLogic

Design		: Ujjwal
Developer	: Dharma

********************************************************************************/


package com.makeLogic.utils;

import java.awt.*;
import java.io.PrintStream;
import java.io.*;
import javax.swing.*;
import javax.swing.text.html.*;
import javax.swing.event.*;
import javax.swing.border.EtchedBorder;
import com.makeLogic.*;

public class HelpDialog extends JDialog{

	int height;
	int width;

	public HelpDialog(JFrame owner){
		
		//..Call the super class
		super(owner);

		Trace.enter("HelpDialog.HelpDialog");
		
		setTitle("Help - Usage");
		getContentPane().setLayout(new BorderLayout());
		setModal(true);

		//..Show the help doc in HTML View
		JEditorPane editorPane = new JEditorPane();
		editorPane.setEditorKit(new HTMLEditorKit()); 

		//..Get current classloader 
		ClassLoader cl = this.getClass().getClassLoader();
		Toolkit toolkit = Toolkit.getDefaultToolkit();

		String html = getHTML(cl.getResourceAsStream("description.html"));

		editorPane.setText(html);

		editorPane.setEditable(false);
		editorPane.getAutoscrolls();
		editorPane.addHyperlinkListener(new HyperActive());
		editorPane.setBorder(new EtchedBorder());
		
		getContentPane().add(editorPane, "Center");

		height = 600;
		width = 800;
		Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
		setLocation((dimension.width - width) / 2, (dimension.height - height) / 2);
		setSize(width, height);
		setResizable(false);

		Trace.exit("HelpDialog.HelpDialog");
	}

	public String getHTML(InputStream htmlStream)
	{
		String returnHtml = "";
		String line = "";

		try
		{
			DataInputStream dis = new DataInputStream(htmlStream);

			while(true)
			{
				line = dis.readLine();

				if(line != null)
				{
					returnHtml += line;
				}
				else
				{
					break;
				}
			}

			return returnHtml;
		}
		catch(Exception ex)
		{
			return "";
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
Founder of MakeLogic - A Mobile Solutions and XML Web Services Company. B-Tech engineer from India's reputed IITs.

Designed and Authored products like MicroGraphs, MakeLogic VersionManager and MakeLogic Device Broker. Pls see http://www.makelogic.com

MakeLogic is a strategic business partner of Microsoft, Sun, IBM, HP and Citrix.

Contact : madanuuk@makelogic.com OR +91 - 40 - 55322433

Comments and Discussions