/** * * FILE: DataDialogActionListener.java * * DataDialogActionListener listens for a button click. * Once the a button is clicked then the dialog box is closed. * If the "Execute" button was pressed then the user input is stored * in the JobSelect object. If "Cancel" was pressed then a cancel * value is returned. * * Compiled and tested with JDK 1.1.4 * * @author Chad (shod) Darby, darby@j-nine.com * * @version v4.34am, 18 Feb 1998 * */ import java.awt.event.*; import java.awt.*; public class DataDialogActionListener implements ActionListener { Frame parent; DataDialog myDataDialog; public DataDialogActionListener() { } public DataDialogActionListener(DataDialog aDataDialog) { myDataDialog = aDataDialog; } public void actionPerformed(ActionEvent event) { String buttonString = event.getActionCommand(); if (buttonString.equals("Execute")) { myDataDialog.setRate( myDataDialog.rateTextField.getText() ); myDataDialog.setJobCategory( myDataDialog.jobCategoryChoice.getSelectedItem() ); } else { myDataDialog.setJobCategory( "CANCEL" ); } myDataDialog.setVisible(false); } }