public class

Button

extends ButtonBase
java.lang.Object
   ↳ com.google.gwt.user.client.ui.UIObject
     ↳ com.google.gwt.user.client.ui.Widget
       ↳ com.google.gwt.user.client.ui.FocusWidget
         ↳ com.google.gwt.user.client.ui.ButtonBase
           ↳ com.google.gwt.user.client.ui.Button
Known Direct Subclasses

Class Overview

A standard push-button widget.

CSS Style Rules

.gwt-Button
the outer element

Example

{@example com.google.gwt.examples.ButtonExample}

Summary

[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
Button()
Creates a button with no caption.
Button(SafeHtml html)
Creates a button with the given HTML caption.
Button(String html)
Creates a button with the given HTML caption.
Button(String html, ClickListener listener)
This constructor is deprecated. Use Button(String, ClickHandler) instead
Button(SafeHtml html, ClickHandler handler)
Creates a button with the given HTML caption and click listener.
Button(String html, ClickHandler handler)
Creates a button with the given HTML caption and click listener.
Protected Constructors
Button(Element element)
This constructor may be used by subclasses to explicitly use an existing element.
Public Methods
void click()
Programmatic equivalent of the user clicking the button.
static Button wrap(Element element)
Creates a Button widget that wraps an existing <button> element.
Protected Methods
ButtonElement getButtonElement()
Get the underlying button element.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.ui.ButtonBase
From class com.google.gwt.user.client.ui.FocusWidget
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.google.gwt.event.dom.client.HasBlurHandlers
From interface com.google.gwt.event.dom.client.HasClickHandlers
From interface com.google.gwt.event.dom.client.HasDoubleClickHandlers
From interface com.google.gwt.event.dom.client.HasFocusHandlers
From interface com.google.gwt.event.dom.client.HasGestureChangeHandlers
From interface com.google.gwt.event.dom.client.HasGestureEndHandlers
From interface com.google.gwt.event.dom.client.HasGestureStartHandlers
From interface com.google.gwt.event.dom.client.HasKeyDownHandlers
From interface com.google.gwt.event.dom.client.HasKeyPressHandlers
From interface com.google.gwt.event.dom.client.HasKeyUpHandlers
From interface com.google.gwt.event.dom.client.HasMouseDownHandlers
From interface com.google.gwt.event.dom.client.HasMouseMoveHandlers
From interface com.google.gwt.event.dom.client.HasMouseOutHandlers
From interface com.google.gwt.event.dom.client.HasMouseOverHandlers
From interface com.google.gwt.event.dom.client.HasMouseUpHandlers
From interface com.google.gwt.event.dom.client.HasMouseWheelHandlers
From interface com.google.gwt.event.dom.client.HasTouchCancelHandlers
From interface com.google.gwt.event.dom.client.HasTouchEndHandlers
From interface com.google.gwt.event.dom.client.HasTouchMoveHandlers
From interface com.google.gwt.event.dom.client.HasTouchStartHandlers
From interface com.google.gwt.event.logical.shared.HasAttachHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.safehtml.client.HasSafeHtml
From interface com.google.gwt.user.client.EventListener
From interface com.google.gwt.user.client.ui.Focusable
From interface com.google.gwt.user.client.ui.HasEnabled
From interface com.google.gwt.user.client.ui.HasHTML
From interface com.google.gwt.user.client.ui.HasText
From interface com.google.gwt.user.client.ui.IsWidget
From interface com.google.gwt.user.client.ui.SourcesClickEvents
From interface com.google.gwt.user.client.ui.SourcesFocusEvents
From interface com.google.gwt.user.client.ui.SourcesKeyboardEvents
From interface com.google.gwt.user.client.ui.SourcesMouseEvents

Public Constructors

public Button ()

Creates a button with no caption.

public Button (SafeHtml html)

Creates a button with the given HTML caption.

Parameters
html the HTML caption

public Button (String html)

Creates a button with the given HTML caption.

Parameters
html the HTML caption

public Button (String html, ClickListener listener)

This constructor is deprecated.
Use Button(String, ClickHandler) instead

Creates a button with the given HTML caption and click listener.

Parameters
html the HTML caption
listener the click listener

public Button (SafeHtml html, ClickHandler handler)

Creates a button with the given HTML caption and click listener.

Parameters
html the html caption
handler the click handler

public Button (String html, ClickHandler handler)

Creates a button with the given HTML caption and click listener.

Parameters
html the HTML caption
handler the click handler

Protected Constructors

protected Button (Element element)

This constructor may be used by subclasses to explicitly use an existing element. This element must be a <button> element.

Parameters
element the element to be used

Public Methods

public void click ()

Programmatic equivalent of the user clicking the button.

public static Button wrap (Element element)

Creates a Button widget that wraps an existing <button> element. This element must already be attached to the document. If the element is removed from the document, you must call detachNow(Widget).

Parameters
element the element to be wrapped

Protected Methods

protected ButtonElement getButtonElement ()

Get the underlying button element.

Returns