The PushButton is a really handy little thing. It is styleable, you can give it two lots of text, one for the up-state, one for the down-state. Or you can do the same with two images.
It doesn't have a mouse listener unfortunately, which is odd, but they make up for it with css styles. But...
The PushButton styles let you determine the look for (when enabled) 'up', 'up-hovering', 'down', 'down, hovering' - so you can't get a button-is-being-pushed look. If you try the menu buttons on this site you get a look if you are actually pressing the button. You can't get that with this widget.
PushButton widget = new PushButton("Click Me", "Get Off!");
widget.setStylePrimaryName("demo-PushButton");
/***********************************************************
* PushButton Demo
***********************************************************/
.demo-PushButton
{
border : 1px solid #666;
margin : 3px 1px;
font-size : 80%;
cursor : hand;
cursor : pointer;
background-color : #ff0;
padding : 0 10px;
}
.demo-PushButton-down-hovering
{
background-color : #ccf;
}
.demo-PushButton-up-hovering
{
background-color : #0f0;
}