Search code examples
gwt

GWT link button


How to I make a hyperlink that functions as a button? Or how do I make a button that looks like a hyperlink?


Solution

  • One easy way is to use the Label class. Just create a new label and add a ClickHandler to it. You can then style it however you want using CSS:

    Label lbl = new Label("Hello");
    lbl.addClickHandler(...);
    lbl.setStyleName("hyperlink_style_label");