Value Field

Purpose

This extension provides developers with the ULCValueField component that allows increasing/decreasing an integer value using the up/down buttons or the keyboard cursor keys. In addition, direct editing of the integer value is supported. For each value field, a minimum and maximum value can be specified.

ULCValueField

How to use

The following shows a sample use of the ULCValueField component:

...

ULCValueField valueField = new ULCValueField(); valueField.setMinimum(-100); valueField.setMaximum(100); valueField.setValue(0); valueField.setColumns(3);

...

In addition, an IValueChangedListener can be registered that is notified whenever the ULCValueField value changes.

...

valueField.addValueChangedListener(new IValueChangedListener() { public void valueChanged(ValueChangedEvent event) { System.out.println("ULCValueField value changed."); } });

...

How it is implemented

The UIValueField class serves as a proxy to the ULCValueField class on the server side. It configures the client-side JValueField Swing component and sends the ValueChangedEvents to the server-side.

Resources