cage.utility
Class OnActionClickerLayoutSwitcher

java.lang.Object
  extended by cage.utility.OnActionClickerLayoutSwitcher
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class OnActionClickerLayoutSwitcher
extends java.lang.Object
implements java.awt.event.ActionListener

Implementation of an ActionListener that shows a certain component in a Container with a CardLayout.

Note that this class assumes container has a CardLayout . If this is not the case the actionPerformed method will throw a ClassCastException.


Constructor Summary
OnActionClickerLayoutSwitcher(javax.swing.AbstractButton b, java.awt.Container c)
          Constructs a OnActionClicker object.
OnActionClickerLayoutSwitcher(javax.swing.AbstractButton b, java.awt.Container c, javax.swing.AbstractButton target)
          Constructs a OnActionClicker object and registers it with target.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnActionClickerLayoutSwitcher

public OnActionClickerLayoutSwitcher(javax.swing.AbstractButton b,
                                     java.awt.Container c)
Constructs a OnActionClicker object.

Parameters:
b - A button that is selected after the actionPerformed method.
c - The container for which the layout needs to be switched.

OnActionClickerLayoutSwitcher

public OnActionClickerLayoutSwitcher(javax.swing.AbstractButton b,
                                     java.awt.Container c,
                                     javax.swing.AbstractButton target)
Constructs a OnActionClicker object and registers it with target.

Parameters:
b - A button that is selected after the actionPerformed method.
c - The container for which the layout needs to be switched.
target - A button with which this listener will be registered.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener