Skip to content
relu91 edited this page May 14, 2014 · 1 revision

Table of Contents

Button

Description

The Button control displays a simple Button which can be clicked by the user. Button creation is dynamically possible from Java with the ButtonBuilder class as well as from XML using Niftys Standard <control></control> Tag.

Java API

Button

Standard Parameters

The following table describes all Button parameters.

Name Datatype Default Description
label String "" The button label text.

EventBus Notification

The Button supports EventBus notification for any action that activates the Button (Mouse click or Keyboard Activation). In that case a ButtonClickedEvent is published using the id of the Button as the Topic for the Event. Please Note that the ButtonClickedEvent is just an empty class. If you receive it then the button has been activated.

ButtonClickedEvent

Java Builder Example

// Using the builder pattern
control(new ButtonBuilder("appendButton", "Append"));

XML Example

<!-- simple button. please note: event notification requires an id -->
<control id="appendButton" name="button" label="Append" />

Back to Nifty Standard Controls (Nifty 1.3)