charvax.swing

Class JButton

Implemented Interfaces:
EventListener, ItemSelectable, KeyListener

public class JButton
extends AbstractButton

An implementation of a "pushbutton" with a text label.

Field Summary

Fields inherited from class charvax.swing.AbstractButton

_actionListeners, _itemListeners

Fields inherited from class charvax.swing.JComponent

_border

Fields inherited from class charva.awt.Component

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT, _alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible

Constructor Summary

JButton()
Default constructor - construct a button with an empty label.
JButton(String text_)

Method Summary

void
debug(int level_)
void
draw()
Draw the button.
int
getHeight()
Dimension
getSize()
Return the size of the button.
int
getWidth()
Dimension
minimumSize()
Called by the LayoutManager.
void
processKeyEvent(KeyEvent ke_)
Processes key events occurring on this object by dispatching them to any registered KeyListener objects.
void
requestFocus()
void
setLabel(String label_)
Deprecated. Replaced by setText(String text)
void
setText(String label_)
String
toString()

Methods inherited from class charvax.swing.AbstractButton

addActionListener, addItemListener, doClick, fireActionPerformed, fireItemStateChanged, getActionCommand, getLabel, getLabelString, getMnemonic, getText, isSelected, keyPressed, keyReleased, keyTyped, processEvent, processMouseEvent, removeItemListener, setActionCommand, setLabel, setMnemonic, setSelected, setText

Methods inherited from class charvax.swing.JComponent

draw, getBorder, getInsets, setBorder

Methods inherited from class charva.awt.Component

addFocusListener, addKeyListener, contains, contains, debug, draw, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getHeight, getLocation, getLocationOnScreen, getName, getParent, getSize, getWidth, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, minimumSize, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, repaint, requestFocus, requestSync, setBackground, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor

Constructor Details

JButton

public JButton()
Default constructor - construct a button with an empty label.

JButton

public JButton(String text_)

Method Details

debug

public void debug(int level_)
Overrides:
debug in interface Component

draw

public void draw()
Draw the button. Called by this JButton's parent container.
Overrides:
draw in interface JComponent

getHeight

public int getHeight()
Overrides:
getHeight in interface Component

getSize

public Dimension getSize()
Return the size of the button. The button is always one line high, and two columns wider than the label, plus the size of the border (if any).
Overrides:
getSize in interface Component

getWidth

public int getWidth()
Overrides:
getWidth in interface Component

minimumSize

public Dimension minimumSize()
Called by the LayoutManager.
Overrides:
minimumSize in interface Component

processKeyEvent

public void processKeyEvent(KeyEvent ke_)
Processes key events occurring on this object by dispatching them to any registered KeyListener objects.
Overrides:
processKeyEvent in interface Component

requestFocus

public void requestFocus()
Overrides:
requestFocus in interface Component

setLabel

public void setLabel(String label_)

Deprecated. Replaced by setText(String text)

Overrides:
setLabel in interface AbstractButton

setText

public void setText(String label_)
Overrides:
setText in interface AbstractButton

toString

public String toString()