fwpUtil
Class TextViewer

public class TextViewer
extends javax.swing.JDialog
Title: An basic text file viewer.

Description: This code displays a basic text viewer with a vertical scroll bar. Its purpose is to display standard text help files from within an application program.

Copyright: Copyright (c) 2011

Company: This code is placed in the public domain for un-restricted use. The user is totally responsible for verifying the correct operation of the code, or adapted code, in their application.

Version:
1.0

Author:
Fred Pospeschil
See Also:
Robert Eckstein et al., Java Swing, (Sebastopol, CA, O’Reilly & Associates, Inc., 1998) pp 712-720

NOTE: This JavaDoc file was post processed with Microsoft FrontPage and regenerating the file will cause the graphics and format changes to be lost.

Constructor Detail

TextViewer

public TextViewer(java.lang.String filePath,
                  java.lang.String fileName)
A basic viewer for disk based text files. This version is called by other than a Dialog or Frameobject. The constructor concatinates the filePath + fileName strings to form the full path\filename string which is used to load the text file. It's intended purpose is for viewing local disk based text files.

The viewer is non-modal so the user can scroll/read the contents while still working with the application program.

The filePath and fileName are displayed as the title of the viewer.

When building the filePath string, suggest using:
filePath = System.getProperty("user.dir") +"\\";
 or
filePath = System.getProperty("user.dir") + System.getProperty("file.separator");

A valid path\filename would be C:\MicroMap\MicorMapLog.txt

Parameters:
filePath - The full path to the text file ending with a file seperator.

fileName - The full file name with a .txt extension

Method Detail

toString

public java.lang.String toString()
Returns the name of the class.
Returns:
The name of the class - TextViewer.