org.gnu.gtk

Class AccelLabel

public class AccelLabel extends Label

The AccelLabel widget is a subclass of Label that also displays an accelerator key on the right side of the label text, e.g. 'Ctrl+S'. It is commonly used in menus to show the keyboard shortcut for the command.

The accelerator key to display is not set explicitly. Instead, the AccelLabel displays the accelerator which have been added to a particular widget. This widget is set by calling setAccelWidget().

Constructor Summary
AccelLabel(String str)
Create an AccelLabel.
AccelLabel(Handle handle)
Construct a AccelLabel using a handle to a native resource.
Method Summary
static AccelLabelgetAccelLabel(Handle handle)
Internal static factory method to be used by Java-Gnome only.
WidgetgetAccelWidget()
Retrieve the widget for this AccelLabel
intgetAccelWidth()
Returns the width needed to display the accelerator key(s).
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidsetAccelWidget(Widget accelWidget)
Set the widget for this AccelLabel

Constructor Detail

AccelLabel

public AccelLabel(String str)
Create an AccelLabel.

AccelLabel

public AccelLabel(Handle handle)
Construct a AccelLabel using a handle to a native resource.

Method Detail

getAccelLabel

public static AccelLabel getAccelLabel(Handle handle)
Internal static factory method to be used by Java-Gnome only.

getAccelWidget

public Widget getAccelWidget()
Retrieve the widget for this AccelLabel

getAccelWidth

public int getAccelWidth()
Returns the width needed to display the accelerator key(s). This is used by menus to align all of the MenuItem widgets and shouldn't be needed by applications.

Returns: The width needed to display the accelerator keys.

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.

setAccelWidget

public void setAccelWidget(Widget accelWidget)
Set the widget for this AccelLabel