try something like this:
Code:
final Text forgotPwd = new Text("forgot password");
forgotPwd.setTagName("span");
forgotPwd.setStyleAttribute("cursor","pointer");
forgotPwd.sinkEvents(Event.ONCLICK);
forgotPwd.sinkEvents(Event.MOUSEEVENTS);
forgotPwd.addListener(Events.OnClick, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
// put your action here, e.g. textField.setVisible(true);
}
});
forgotPwd.addListener(Events.OnMouseOver, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
forgotPwd.setStyleAttribute("color", "blue");
}
});
forgotPwd.addListener(Events.OnMouseOut, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
forgotPwd.setStyleAttribute("color", "black");
}
});