public class Toggle extends Object
Constructor and Description |
---|
Toggle()
Initializes this toggle by setting it to on.
|
Modifier and Type | Method and Description |
---|---|
int |
getColor()
Returns the color Color.GREEN if this toggle is on, and
returns the color Color.RED if this toggle is off.
|
String |
getText()
Returns the text "Press me" if this toggle is on, and
returns the text "Again" if this toggle is off.
|
void |
it()
Switched this toggle from on to off or from off to on.
|
public void it()
public String getText()
public int getColor()