/*
Project 8
ValidityChecks
Programmer:
Brad Shedd
Date:
September 3, 2006
Program Name:
ValidityChecks.java
*/
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.text.*;
public
class
Checks
extends Frame
implements
ActionListener
{
//Declare an
input variable
//Construct components
public
static
void
main(String[] args)
{
Checks
window =
new
Checks();
window.setTitle("This
month's 10 Hottest Checks");
window.setSize(300, 175);
window.setVisible(true);
}
public
Checks()
{
//Set colors
//Set layout managers
//Add components and actionListener to interface
try
{
//Open the file
input =
new
DataInputStream(new
FileInputStream("Checks.dat"));
}
catch(IOException
ex)
{
closeFile();
}
//Construct
window listener
addWindowListener(
new
WindowAdapter()
{
public
void windowClosing(WindowEvent e)
{
closeFile();
}
}
);
}
public
void actionPerformed(ActionEvent e)
{
try
{
//Read the data into the text fields
}
catch(IOException
e2)
{
//Print End of file message and clear fields
}
}
public
void closeFile()
{
try
{
input.close();
}
catch(IOException
c)
{
System.exit(1);
}
System.exit(0);
}
}