Take_Product_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_Product_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_Product_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 product bin
  28|         if(oC.jbtnProductBin.getText() != "Empty")
  29|         {
  30|             oC.jbtnProductBin.setText("Empty");
  31|         }
  32| 
  33|         //Restores generic color to product bin button
  34|         if(oC.jbtnProductBin.getBackground() != oC.oDefault)
  35|         {
  36|             oC.jbtnProductBin.setBackground(oC.oDefault);
  37|         }
  38|     }
  39| 
  40| }