/** * * FILE: UpdateActionListener.java * * UpdateActionListener listens for the "Update..." button click. * Once the "Update..." button is clicked then the dialog box is displayed * and user input is received and passed back to the "JobSelect" object for * execution. * * 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.*; import java.awt.event.*; import DataDialog; public class UpdateActionListener implements ActionListener { String updateRateTitle = "Update Hourly Rates"; String updateRateMessage = "Enter the new rate and job category"; DataDialog myDataDialog; JobSelect parent; public UpdateActionListener(JobSelect theParent) { parent = theParent; } public void actionPerformed(ActionEvent event) { // show hourly rate dialog myDataDialog = new DataDialog(parent, updateRateTitle, updateRateMessage); myDataDialog.setVisible(true); String updateRateString = myDataDialog.getRate(); String updateJobCategoryString = myDataDialog.getJobCategory(); // send data back to parent if ( updateJobCategoryString.equals("CANCEL") ) { return; } else { parent.executeUpdateHourlyRate(updateRateString, updateJobCategoryString); } } }