我得到這個代碼:在GWT,改變標籤的背景,當鼠標懸停
private class MyLabel extends Label implements MouseOverHandler, MouseOutHandler {
public void onMouseOver(final MouseOverEvent moe) {
this.getElement().getStyle().setBackgroundColor("E6D5D5");
}
@Override
public void onMouseOut(MouseOutEvent event) {
// TODO Auto-generated method stub
this.getElement().getStyle().setBackgroundColor("FFFFFF");
}
}
MyLabel lb=new MyLabel();
lb.setText("ok");
但什麼也沒發生,所以有什麼錯在我的代碼?
任何人都可以幫助我解決它嗎?
的#盈實際上這將是'lb.addMouse ...(磅)的''而不是this'。 – 2013-04-08 05:47:05