charvax.swing
Class JTextField

java.lang.Object
  extended bycharva.awt.Component
      extended bycharvax.swing.JComponent
          extended bycharvax.swing.text.JTextComponent
              extended bycharvax.swing.JTextField
Direct Known Subclasses:
CapsTextField, JPasswordField

public class JTextField
extends JTextComponent

Support for public void setBounds( Rectangle bounds ) public void setBounds( int top_, int left_, int bottom_, int right_) public void setBounds(Point topleft_, Dimension size_)


Field Summary
protected  java.util.Vector _actionListeners
          A list of ActionListeners registered for this component.
protected  boolean _bold
           
protected  int _columns
           
protected  int _offset
          Index (from the start of the string) of the character displayed in the left corner of the field.
protected  java.lang.String _padding
          A blank-filled string the same length as the JTextField.
 
Fields inherited from class charvax.swing.text.JTextComponent
_caretPosition, _document, _editable
 
Fields inherited from class charvax.swing.JComponent
_border
 
Fields inherited from class charva.awt.Component
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JTextField()
          Construct a text field.
JTextField(int length_)
          Use this constructor when you want to leave the text field empty but set its length.
JTextField(java.lang.String text_)
          Use this constructor when you want to initialize the value.
JTextField(java.lang.String text_, int length_)
          Use this constructor when you want to set both the initial value and the length.
 
Method Summary
 void addActionListener(ActionListener al_)
          Register an ActionListener object for this component.
 void debug(int level_)
           
 void draw()
          Called by this JTextField's parent container.
 java.lang.String getActionCommand()
          Get the action command
 int getColumns()
          Return the number of columns in the text field.
 int getHeight()
           
 Dimension getSize()
          Return the size of the text field.
 int getWidth()
           
 boolean isEditable()
          Returns the boolean flag indicating whether this TextComponent is editable or not.
 Dimension minimumSize()
          Called by the LayoutManager.
 void postActionEvent(ActionEvent ae_)
          Invoke all the ActionListener callbacks that may have been registered for this component.
protected  void processEvent(AWTEvent evt_)
          Process events.
 void processKeyEvent(KeyEvent ke_)
          Process KeyEvents that have been generated by this JTextField.
 void processMouseEvent(MouseEvent e_)
          Process a MouseEvent that was generated by clicking the mouse somewhere inside this JTextField.
 void requestFocus()
          This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.
 void setActionCommand(java.lang.String cmd_)
          Set the action command
 void setBounds(int top_, int left_, int bottom_, int right_)
           
 void setBounds(Point topleft_, Dimension size_)
           
 void setBounds(Rectangle bounds)
           
 void setColumns(int columns_)
          Sets the number of columns in this Textfield, and then invalidates the layout.
 void setEditable(boolean editable_)
          Sets whether this textfield can be edited.
 void setFont(Font font_)
           
 void setText(java.lang.String text_)
          Set the text that is presented by this JTextField.
 java.lang.String toString()
          Returns a String representation of this component.
 
Methods inherited from class charvax.swing.text.JTextComponent
getCaretPosition, getDocument, getText, setCaretPosition, setDocument
 
Methods inherited from class charvax.swing.JComponent
getBorder, getInsets, setBorder
 
Methods inherited from class charva.awt.Component
addFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, processFocusEvent, repaint, requestSync, setBackground, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_bold

protected boolean _bold

_columns

protected int _columns

_offset

protected int _offset
Index (from the start of the string) of the character displayed in the left corner of the field. This is always 0 if the string is shorter than the field.


_padding

protected java.lang.String _padding
A blank-filled string the same length as the JTextField.


_actionListeners

protected java.util.Vector _actionListeners
A list of ActionListeners registered for this component.

Constructor Detail

JTextField

public JTextField()
Construct a text field. The initial string is empty and the number of columns is 10.


JTextField

public JTextField(java.lang.String text_)
Use this constructor when you want to initialize the value.


JTextField

public JTextField(int length_)
Use this constructor when you want to leave the text field empty but set its length.


JTextField

public JTextField(java.lang.String text_,
                  int length_)
Use this constructor when you want to set both the initial value and the length.

Method Detail

setColumns

public void setColumns(int columns_)
Sets the number of columns in this Textfield, and then invalidates the layout.


setBounds

public void setBounds(Rectangle bounds)
Overrides:
setBounds in class Component

setBounds

public void setBounds(int top_,
                      int left_,
                      int bottom_,
                      int right_)
Overrides:
setBounds in class Component

setBounds

public void setBounds(Point topleft_,
                      Dimension size_)
Overrides:
setBounds in class Component

getColumns

public int getColumns()
Return the number of columns in the text field.


setFont

public void setFont(Font font_)

setActionCommand

public void setActionCommand(java.lang.String cmd_)
Set the action command


getActionCommand

public java.lang.String getActionCommand()
Get the action command


getSize

public Dimension getSize()
Return the size of the text field. Overrides the method in the Component superclass.

Specified by:
getSize in class Component

getWidth

public int getWidth()
Specified by:
getWidth in class Component

getHeight

public int getHeight()
Specified by:
getHeight in class Component

minimumSize

public Dimension minimumSize()
Called by the LayoutManager.

Specified by:
minimumSize in class Component

setEditable

public void setEditable(boolean editable_)
Sets whether this textfield can be edited.

Overrides:
setEditable in class JTextComponent

isEditable

public boolean isEditable()
Description copied from class: JTextComponent
Returns the boolean flag indicating whether this TextComponent is editable or not.

Overrides:
isEditable in class JTextComponent

draw

public void draw()
Called by this JTextField's parent container.

Overrides:
draw in class JComponent

processKeyEvent

public void processKeyEvent(KeyEvent ke_)
Process KeyEvents that have been generated by this JTextField.

Overrides:
processKeyEvent in class Component

processMouseEvent

public void processMouseEvent(MouseEvent e_)
Process a MouseEvent that was generated by clicking the mouse somewhere inside this JTextField. Clicking the mouse inside the JTextField moves the caret position to where the mouse was clicked.

Overrides:
processMouseEvent in class Component

setText

public void setText(java.lang.String text_)
Set the text that is presented by this JTextField. This method is thread-safe, although most Charva methods are not.

Overrides:
setText in class JTextComponent

processEvent

protected void processEvent(AWTEvent evt_)
Process events.

Overrides:
processEvent in class Component

postActionEvent

public void postActionEvent(ActionEvent ae_)
Invoke all the ActionListener callbacks that may have been registered for this component.


addActionListener

public void addActionListener(ActionListener al_)
Register an ActionListener object for this component.


requestFocus

public void requestFocus()
Description copied from class: Component
This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.

Overrides:
requestFocus in class Component

toString

public java.lang.String toString()
Returns a String representation of this component.


debug

public void debug(int level_)
Specified by:
debug in class Component