Vijay
Vijay

Reputation: 1026

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

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.?

Upvotes: 3

Views: 1257

Answers (2)

Sithsu
Sithsu

Reputation: 2219

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

Upvotes: 1

Suresh Atta
Suresh Atta

Reputation: 122018

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;
}

Upvotes: 6

Related Questions