Take_Change_Event_Class

    1| /*
    2| NTC Java Programming 152-116
    3| Instructor: John Heckendorf
    4| Student: Jan Young & Keith Gallistel
    5| Lab ID: & 46314
    6| Project:pepsi.java
    7| */
    8| 
    9| import javax.swing.*;
  10| import java.awt.event.*;
  11| 
  12| public class Take_Change_Event_Class extends JFrame implements ActionListener
  13| {
  14|     final static long serialVersionUID = 5;
  15| 
  16|     Control_Class oC;
  17| 
  18|     //Instantiated Class
  19|     public Take_Change_Event_Class(Control_Class oControl)
  20|     {
  21|         oC = oControl;
  22|     }
  23| 
  24|     //Method that will process GUI events
  25|     public void actionPerformed(ActionEvent e)
  26|     {
  27|         //Resets change bin
  28|         if(oC.jbtnChangeBin.getText() != "Change")
  29|         {
  30|             oC.jbtnChangeBin.setText("Change");
  31|         }
  32| 
  33|         //Restores generic color to change bin button
  34|         if(oC.jbtnChangeBin.getBackground() != oC.oDefault)
  35|         {
  36|             oC.jbtnChangeBin.setBackground(oC.oDefault);
  37|         }
  38| }