Class ToggleButton

Class ToggleButton

java.lang.Object
   |
   +----Button
           |
           +----ToggleButton

class ToggleButton
extends Button
ToggleButton is the class for buttons with to states.

Constructor Index

 o ToggleButton(int, String, String, int, int, int, int, Font, Font, boolean)
Creates a toggle button.

Method Index

 o GetChoosed()
Returns the state of the button.
 o drawButton(Graphics)
 o mouseUpButton(int, int)

Constructors

 o ToggleButton
  public ToggleButton(int bnum,
                      String l,
                      String cl,
                      int x,
                      int y,
                      int w,
                      int h,
                      Font f,
                      Font cf,
                      boolean cho)
Creates a toggle button. This button has two states represended by two labels and two fonts.
Parameters:
bnum - id-number for the button
l - label for state one
cl - label for state two
x - x-ccordinate of the button
y - y-coordinate of the button
w - the size().width
h - the size().height
f - the font used for the label in state one
cf - the font used for the label in state two
cho - initialize the ToggleButton in state two?

Methods

 o GetChoosed
  public boolean GetChoosed()
Returns the state of the button.
Returns:
is the button in state two?
 o drawButton
  protected void drawButton(Graphics g)
Overrides:
drawButton in class Button
 o mouseUpButton
  protected boolean mouseUpButton(int x,
                                  int y)
Overrides:
mouseUpButton in class Button