charvax.swing

Class JLabel


public class JLabel
extends JComponent

A display area for a short text string. A label cannot react to keyboard events and cannot receive the keyboard focus.

Field Summary

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

JLabel()
Construct an empty label.
JLabel(String text_)
Construct a JLabel with the specified text.
JLabel(String text_, int align_)
Use this constructor if you want to set the alignment to something other than left-aligned.

Method Summary

void
debug(int level_)
void
draw()
int
getHeight()
Dimension
getSize()
This may be wrong, but it'll do for now.
String
getText()
int
getWidth()
boolean
isFocusTraversable()
This component will not receive focus when Tab or Shift-Tab is pressed.
Dimension
minimumSize()
void
processKeyEvent(KeyEvent ke_)
The JLabel class ignores key events.
void
requestFocus()
The JLabel component never gets the keyboard input focus.
void
setLength(int length_)
void
setText(String label_)
String
toString()

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, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor

Constructor Details

JLabel

public JLabel()
Construct an empty label.

JLabel

public JLabel(String text_)
Construct a JLabel with the specified text.

JLabel

public JLabel(String text_,
              int align_)
Use this constructor if you want to set the alignment to something other than left-aligned.

Method Details

debug

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

draw

public void draw()
Overrides:
draw in interface JComponent

getHeight

public int getHeight()
Overrides:
getHeight in interface Component

getSize

public Dimension getSize()
This may be wrong, but it'll do for now.
Overrides:
getSize in interface Component

getText

public String getText()

getWidth

public int getWidth()
Overrides:
getWidth in interface Component

isFocusTraversable

public boolean isFocusTraversable()
This component will not receive focus when Tab or Shift-Tab is pressed.
Overrides:
isFocusTraversable in interface Component

minimumSize

public Dimension minimumSize()
Overrides:
minimumSize in interface Component

processKeyEvent

public void processKeyEvent(KeyEvent ke_)
The JLabel class ignores key events. A JLabel should never have input focus anyway.
Overrides:
processKeyEvent in interface Component

requestFocus

public void requestFocus()
The JLabel component never gets the keyboard input focus.
Overrides:
requestFocus in interface Component

setLength

public void setLength(int length_)

setText

public void setText(String label_)

toString

public String toString()