Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there any way to set the cursor style of a GWT button in code?

Tags:

java

gwt

I have seen some details from

http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/dom/client/Style.Cursor.html

Did not see any example using this. I have put css class style but still cursor does not get the required cursor style. can any one give an example please.?

like image 509
Vijay Avatar asked Dec 02 '25 10:12

Vijay


2 Answers

This might be helpful

button.getElement().getStyle().setCursor(Cursor.POINTER);  

But gwt prefer css directly

and by adding css style to the button(**preffered**)

button.addStyleName(mybuttonStyle);


.mybuttonStyle{
   cursor: pointer;
}
like image 75
Suresh Atta Avatar answered Dec 05 '25 00:12

Suresh Atta


In case this is a SmartGWT application and you want to set the cursor for a SmartGWT widget, you can use Canvas.setCursor().

IButton button = new IButton("Hover over");
button.setCursor(Cursor.CROSSHAIR);

http://forums.smartclient.com/showthread.php?p=68560

like image 20
Sithsu Avatar answered Dec 04 '25 23:12

Sithsu