public class GButton extends GComponent implements GDisplay, ActionListener
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GButton(ImageIcon ico)
Constructor to create a button with an icon on it.
|
GButton(String text)
Constructor to create a button with a string label on it.
|
GButton(String widgetId,
ImageIcon ico)
Constructor to create a button with an icon on it.
|
GButton(String widgetId,
String text)
Constructor to create a button with a string label on it.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
JButton |
getJButton()
Get the Swing JButton encapsulated by the class.
|
void |
setIcon(ImageIcon ico)
Set the icon to display in the button.
|
void |
setIcon(String path)
Set the icon to display in the button by the path of the icon file.
|
void |
setShortcut(int shorcutKey)
Set the shortcut key for pushing the GButton.
|
void |
setText(String text)
Set the text to display in the button.
|
void |
setToolTipText(String text)
Set the tooltip text for the entry's label.
|
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setEnabled, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GButton(String text)
text
- to display in the buttons label.public GButton(ImageIcon ico)
ico
- icon to display on the button.public GButton(String widgetId, ImageIcon ico)
widgetId
- Widget identifier.ico
- icon to display on the button.public void setIcon(ImageIcon ico)
ico
- icon to display in the button.public void setText(String text)
text
- text to display in the button.public void setIcon(String path)
path
- of the icon to display in the button.public void display()
public JButton getJButton()
public Component getComponent()
getComponent
in class GComponent
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void setToolTipText(String text)
setToolTipText
in class GComponent
text
- the tooltip text for the entry's label.public void setShortcut(int shorcutKey)
shorcutKey
- the shortcut key to be attached to the button.Copyright © 2024. All rights reserved.