home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
** Copyright (c) 1997 by Timothy Gerard Endres
** 
** This program is free software.
** 
** You may redistribute it and/or modify it under the terms of the GNU
** General Public License as published by the Free Software Foundation.
** Version 2 of the license should be included with this distribution in
** the file LICENSE, as well as License.html. If the license is not
** included	with this distribution, you may find a copy at the FSF web
** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE. 
** 
*/

package com.ice.syslogd;

import java.awt.*;
import java.awt.event.*;
import java.lang.*;
import java.applet.*;

import com.ice.util.AWTUtilities;
import com.ice.util.UserProperties;
import com.ice.widget.BorderPanel;


/**
 * Shows the application's "About" dialog box.
 *
 * @version $Revision: 1.1.1.1 $
 * @author Timothy Gerard Endres,
 *    <a href="mailto:time@ice.com">time@ice.com.
 */

public class
AboutDialog extends Dialog
		implements ActionListener, WindowListener
	{
	public static final String		RCS_ID = "$Id: AboutDialog.java,v 1.1.1.1 1998/02/22 05:47:55 time Exp $";
	public static final String		RCS_REV = "$Revision: 1.1.1.1 $";
	public static final String		RCS_NAME = "$Name:  $";

	private String		messageString;
	private TextArea	messageText;

	public
	AboutDialog( Frame parent )
		{
		super( parent, "About SyslogD", true );

		this.messageString = null;

		this.establishDialogContents();

		this.pack();

		int width =
			UserProperties.getProperty
				( "aboutDialog.width", 540 );
		int height =
			UserProperties.getProperty
				( "aboutDialog.height", 320 );

		this.setSize( width, height );

		Point location =
			AWTUtilities.computeDialogLocation
				( this, width, height );

		this.setLocation( location.x, location.y );

		this.addWindowListener( this );
		}

    public void
    actionPerformed( ActionEvent evt )
        {
	    String command = evt.getActionCommand();

		if ( command.compareTo( "OK" ) == 0 )
			{
			this.dispose();
			}
        }

	public void
	establishDialogContents() 
		{
		Button			button;
		BorderPanel		controlPanel;

 		this.messageText = new TextArea( 12, 64 );
		this.messageText.setEditable( false );
		this.messageText.setFont(
			UserProperties.getFont(
				"aboutDialog.font",
				new Font( "Serif", Font.BOLD, 12 ) ) );

		this.messageText.setText(
			"SyslogD, version " +
			SyslogD.VERSION_STR +
			", a Unix Syslog Server\n" +
			"\n" +
			"Written by Tim Endres, time@ice.com\n" +
			"Copyright (c) 1997 by Timothy Gerard Endres\n" +
			"\n" +
			"SyslogD is free software, which is licensed to you under the\n" +
			"GNU General Public License, version 2. Please see the file\n" +
			"LICENSE for more details, or visit 'www.gnu.org'.\n" +
			"\n" +
			"This software is provided AS-IS, with ABSOLUTELY NO WARRANTY.\n" +
			"\n" +
			"YOU ASSUME ALL RESPONSIBILITY FOR ANY AND ALL CONSEQUENCES\n" +
			"THAT MAY RESULT FROM THE USE OF THIS SOFTWARE!"
			); 

		controlPanel = new BorderPanel
				( 7, 2, 5, BorderPanel.RIDGE );
		controlPanel.setLayout( new GridLayout( 1, 1, 20, 20 ) );

		button = new Button( "Ok" );
		button.addActionListener( this );
		button.setActionCommand( "OK" );
		controlPanel.add( button );

		this.setLayout( new GridBagLayout() );

		AWTUtilities.constrain(
			this, this.messageText,
			GridBagConstraints.BOTH,
			GridBagConstraints.CENTER,
			0, 0, 1, 1, 1.0, 1.0 );

		AWTUtilities.constrain(
			this, controlPanel,
			GridBagConstraints.HORIZONTAL,
			GridBagConstraints.CENTER,
			0, 1, 1, 1, 1.0, 0.0 );

		}

	public void
	windowOpened(WindowEvent e)
		{
		}

	public void
	windowClosing(WindowEvent e)
		{
		this.dispose();
		}

	public void
	windowClosed(WindowEvent e)
		{
		}

	public void
	windowActivated(WindowEvent e)
		{
		}

	public void
	windowDeactivated(WindowEvent e)
		{
		}

	public void
	windowIconified(WindowEvent e)
		{
		}

	public void
	windowDeiconified(WindowEvent e)
		{
		}

	}

new blog posts

 

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.