    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class jclass.bwt.JCTextComponent

    java.lang.Object
       |
       +----java.awt.Component
               |
               +----java.awt.Canvas
                       |
                       +----jclass.bwt.JCComponent
                               |
                               +----jclass.bwt.JCTextComponent

public abstract class JCTextComponent
extends JCComponent
implements JCTextInterface, Runnable

An abstract class used as the superclass for JCTextArea and JCTextField.

Properties

Name | Method
--- | ---
Alignment | setAlignment
Background | setBackground
CaretPosition | setCaretPosition
Changed | setChanged
Columns | setColumns
CursorPosition | setCursorPosition
DoubleBuffer | setDoubleBuffer
Editable | setEditable
Font | setFont
Foreground | setForeground
HighlightColor | setHighlightColor
HighlightThickness | setHighlightThickness
Insets | setInsets
MaximumLength | setMaximumLength
Overstrike | setOverstrike
PreferredSize | setPreferredSize
SelectedBackground | setSelectedBackground
SelectedForeground | setSelectedForeground
SelectionEnd | setSelectionEnd
SelectionList | setSelectionList
SelectionStart | setSelectionStart
ShadowThickness | setShadowThickness
ShowCursorPosition | setShowCursorPosition
StringCase | setStringCase
Text | setText
Traversable | setTraversable
UserData | setUserData

Events

Class | Listener | Description
--- | --- | ---
JCTextEvent | addTextListener | Posted when the value changes
JCTextCursorEvent | addTextCursorListener | Posted when the cursor is moved

See Also:
  JCTextArea, JCTextField

##

CASE_AS_IS
CASE_LOWER
CASE_UPPER
CENTER
cursor_blink_rate
  Cursor's blink rate (ms)
cursorListeners
  List of JCTextCursorEvent listeners.
horiz_origin
  Amount by which the text has been scrolled.
LEFT
li
popup_menu
RIGHT
SELECT_ALL
SELECT_CHAR
SELECT_LINE
SELECT_NONE
SELECT_PARAGRAPH
SELECT_WORD
valueListeners
  List of TextEvent/JCTextEvent listeners.
vert_origin
  Amount by which the text has been scrolled.

##

JCTextComponent()
  Creates an empty component.
JCTextComponent(Applet, String)
  Creates a component which reads parameters from the applet's HTML file.

##

addNotify()
  Creates the peer of the canvas.
addTextCursorListener(JCTextCursorListener)
  Adds the specified JCTextCursorEvent listener to receive cursor movement events.
addTextListener(JCTextListener)
  Adds the specified listener to receive text events.
append(String)
  Appends text to the end.
beep()
  Emits a beep.
blinkCursor(boolean)
  Enables cursor blinking.
cancelSelection()
  Cancels the current selection.
checkCursorPosition(int)
  Resets the position to the range [0,num_char]
cmpKeyStroke(String, int)
copyToClipboard(Event)
  If text is currently selected, copies the selection to the clipboard.
createPopup(Component, int, int)
cutToClipboard(Event)
  If text is currently selected, copies the selection to the clipboard and deletes it from the component.
deleteChar(Event, boolean)
  Deletes the current selection; or a character if no text is selected.
deleteCurrentChar(Event)
  Deletes the character at the current cursor position.
deletePreviousChar(Event)
  Deletes the character before the current cursor position.
deleteRange(int, int)
  Deletes the text between the specified positions.
deleteSelection()
  Deletes the current selection.
disable()
  Disables the component and stops the cursor blinking.
freeze()
getAlignment()
  Gets the field's alignment.
getCaretPosition()
  Gets the position of the cursor (provided for JDK 1.1 compatibility).
getChanged()
  Returns true if the user has changed the value since the last programmatic setting.
getColumns()
  Gets the number of columns.
getCursorPosition()
  Gets the position of the cursor.
getEditable()
  Gets the Editable value.
getLastPosition()
  Gets the position of the last character in the text.
getMaximumLength()
  Gets the MaximumLength value.
getMinimumSize(int)
  Returns the minimum size needed for the specified number of columns.
getNumChar()
  Gets the current number of characters.
getOverstrike()
  Gets the Overstrike value.
getParameters()
  Reads the parameter values from the HTML page using the component's applet.
getSelectedBackground()
  Gets the SelectedBackground value.
getSelectedForeground()
  Gets the SelectedForeground value.
getSelectedText()
  Get the selected part of the text.
getSelectionEnd()
  Returns the end of the selection.
getSelectionList()
  Gets the current SelectionList.
getSelectionStart()
  Returns the start of the selection.
getSelectionType(int)
  Gets the selection type corresponding to the index.
getShowCursorPosition()
  Gets the ShowCursorPosition value.
getStringCase()
  Gets the StringCase value.
getText()
  Gets the value of the text.
gotFocus(Event, Object)
  Starts the cursor blinking if the component is editable.
insert(String, int)
  Inserts text at the specified position.
insertChar(Event, int)
  Inserts a character at the current cursor position.
isEditable()
  Gets the Editable value.
isFrozen()
isLineDelimiter(char)
  Determines whether a character is a line delimiter.
isWordDelimiter(char)
  Determines whether a character is a word delimiter.
keyDown(Event, int)
  Processes keyDown events.
lostFocus(Event, Object)
  Stops the cursor blinking.
mouseDown(Event, int, int)
  Positions the cursor, or if MB2 was pressed, pastes the current clipboard contents.
mouseDrag(Event, int, int)
  Selects the text.
mouseUp(Event, int, int)
  Ends text selection.
moveBackwardChar(Event)
  Moves the cursor backward one character.
moveForwardChar(Event)
  Moves the cursor forward one character.
paintCursor(boolean)
  Paints or erases the cursor, depending on the value of state.
paste(Event)
  Inserts the current clipboard contents at the event's position, after first deleting any selected text.
pasteFromClipboard(Event)
  If the component is editable, inserts the clipboard selection at the current cursor position.
pointToPosition(int, int)
  Converts an x coordinate into a text position.
positionToPoint(int, Point)
  Gets the physical location of a position, ignoring scrolling.
positionToX(int)
  Gets the x co-ordinate for a character position, ignoring scrolling.
positionToY(int)
  Gets the y co-ordinate for a character position, ignoring scrolling.
preferredHeight()
  Returns the height of 1 row.
preferredWidth()
  Returns the width of an 'N' times the specified number of columns.
readClipboard()
  Gets the clipboard contents.
removeTextCursorListener(JCTextCursorListener)
  Removes the specified listener so it no longer receives JCTextCursorEvents.
removeTextListener(JCTextListener)
  Removes the specified text listener so it no longer receives text events.
repaint()
  Overrides Component.repaint(), which does not always call paint().
repaintPositions(int, int)
  Draws the text between 2 positions.
repaintPositions(Point, Point)
  Draws the text between 2 points.
replace(String, int, int)
  Deletes the text from start to end and then inserts, at start, the text that was passed.
replaceRange(String, int, int)
  Replaces text from the indicated start to end positions (inclusive) with the new text specified.
replaceTextInternal(String, int, int)
  Updates the internal text buffer.
reshape(int, int, int, int)
  Reshapes the Component to the specified bounding box.
run()
  Blinks the cursor.
scrollEnd(Event)
  Scrolls to the last line.
scrollHome(Event)
  Scrolls to the first line.
scrollLineBegin(Event)
  Scrolls to the beginning of the current line.
scrollLineEnd(Event)
  Scrolls to the end of the current line.
select(int, int)
  Sets the current selection, and sets the cursor at the end of the selection.
select(int, int, int)
  Selects part of the text.
selectAll()
  Selects all the text, and sets the cursor at the last character.
selectEnd(Event)
  Ends the current selection.
selectExtend(Event)
  Extends the current selection.
selectStart(Event)
  Starts the selection.
setAlignment(int)
  Sets the position of the text:

  LEFT (default), CENTER, or RIGHT.

setCaretPosition(int)
  Sets the position of the cursor (provided for JDK 1.1 compatibility).
setChanged(boolean)
  Resets the Changed flag.
setColumns(int)
  Sets the number of columns.

  HTML param name/value: "Columns"/int

setCursorPosition(int)
  Sets the position of the cursor, and posts a JCTextCursorEvent event.

  HTML param name/value: "CursorPosition"/int

setEditable(boolean)
  If set to true (default), the user can edit the text.

  HTML param name/value: "Editable"/boolean

setFont(Font)
  Sets the font of the component.

  HTML param name/value: "Font"/font

setMaximumLength(int)
  Sets the maximum number of characters which may be entered by the user (default: BWTEnum.MAXINT).
setOverstrike(boolean)
  If false (default), characters typed by the user are inserted into the current text.

  HTML param name/value: "Overstrike"/boolean

setSelectedBackground(Color)
  Sets the background color of selected text (default: blue).

  HTML param name/value: "SelectedBackground"/color

setSelectedForeground(Color)
  Sets the foreground color of selected text (default: background color).

  HTML param name/value: "SelectedForeground"/color

setSelectionEnd(int)
  Sets the selection end to the specified position.
setSelectionList(int[])
  Sets a list of values used for multi-click.
setSelectionStart(int)
  Sets the selection start to the specified position.
setShowCursorPosition(boolean)
  If set to true (default), the cursor position will be indicated with a vertical I-beam.

  HTML param name/value: "ShowCursorPosition"/boolean

setStringCase(int)
  Sets the case of text entered by the user or set programmatically:

      CASE_AS_IS       No conversion (default)
      CASE_LOWER       Convert to lower case
      CASE_UPPER       Convert to upper case

  HTML param name/value: "StringCase"/enum

setText(String)
  Sets the text of this component to the specified text.

  HTML param name/value: "Text"/string

showPosition(int)
  Scrolls the text if necessary to ensure that the position is visible.
toggleOverstrike(Event)
  Toggles the value of the overstrike flag.
unfreeze()
updateScrollbars()
writeClipboard(String)
  Writes to the clipboard.

##

LEFT

     public static final int LEFT

CENTER

     public static final int CENTER

RIGHT

     public static final int RIGHT

CASE_AS_IS

     public static final int CASE_AS_IS

CASE_LOWER

     public static final int CASE_LOWER

CASE_UPPER

     public static final int CASE_UPPER

SELECT_NONE

     public static final int SELECT_NONE

SELECT_CHAR

     public static final int SELECT_CHAR

SELECT_WORD

     public static final int SELECT_WORD

SELECT_LINE

     public static final int SELECT_LINE

SELECT_PARAGRAPH

     public static final int SELECT_PARAGRAPH

SELECT_ALL

     public static final int SELECT_ALL

li

     protected ResourceBundle li

popup_menu

     protected PopupMenu popup_menu

horiz_origin

     protected int horiz_origin

  Amount by which the text has been scrolled.

vert_origin

     protected int vert_origin

  Amount by which the text has been scrolled.

cursorListeners

     protected JCVector cursorListeners

  List of JCTextCursorEvent listeners.

valueListeners

     protected JCVector valueListeners

  List of TextEvent/JCTextEvent listeners.

cursor_blink_rate

     protected int cursor_blink_rate

  Cursor's blink rate (ms)

##

JCTextComponent

     public JCTextComponent()

  Creates an empty component.

JCTextComponent

     public JCTextComponent(Applet applet,
                            String name)

  Creates a component which reads parameters from the applet's HTML file.

  Parameters:
    applet - the applet whose PARAM tags are to be read
    name - if this is not null, only parameters preceded by this name are read
  See Also:
    getParameter

##

getParameters

     protected void getParameters()

  Reads the parameter values from the HTML page using the component's applet. The values will override those previously set.

  Overrides:
    getParameters in class JCComponent

setFont

     public void setFont(Font f)

  Sets the font of the component.

  HTML param name/value: "Font"/font

  Overrides:
    setFont in class JCComponent

getAlignment

     public int getAlignment()

  Gets the field's alignment.

  See Also:
    setAlignment

setAlignment

     public void setAlignment(int v)

  Sets the position of the text:

  LEFT (default), CENTER, or RIGHT. HTML param name/value: "Alignment"/enum

  Throws: IllegalArgumentException
    If an invalid value is set

getChanged

     public boolean getChanged()

  Returns true if the user has changed the value since the last programmatic setting.

setChanged

     public void setChanged(boolean v)

  Resets the Changed flag.

  See Also:
    getChanged

getLastPosition

     public int getLastPosition()

  Gets the position of the last character in the text. This represents the position that text appended to the component would be placed after.

getSelectionStart

     public int getSelectionStart()

  Returns the start of the selection.

  See Also:
    setSelectionStart

setSelectionStart

     public synchronized void setSelectionStart(int v)

  Sets the selection start to the specified position. The new starting point is constrained to be before or at the current selection end.

getSelectionEnd

     public int getSelectionEnd()

  Returns the end of the selection.

  See Also:
    setSelectionEnd

setSelectionEnd

     public synchronized void setSelectionEnd(int v)

  Sets the selection end to the specified position. The new end point is constrained to be at or after the current selection start.

getText

     public synchronized String getText()

  Gets the value of the text.

  See Also:
    setText

setText

     public void setText(String text)

  Sets the text of this component to the specified text.

  HTML param name/value: "Text"/string

  See Also:
    getText

getNumChar

     public int getNumChar()

  Gets the current number of characters.

getMaximumLength

     public int getMaximumLength()

  Gets the MaximumLength value.

  See Also:
    setMaximumLength

setMaximumLength

     public void setMaximumLength(int v)

  Sets the maximum number of characters which may be entered by the user (default: BWTEnum.MAXINT). If the user attempts to enter more characters, the values will be ignored and the bell will be sounded. This value is ignored for values set programmatically.

  HTML param name/value: "MaximumLength"/int

  See Also:
    setText

deleteSelection

     protected boolean deleteSelection()

  Deletes the current selection.

  Returns:
    false if the replacement was disallowed
  See Also:
    addTextListener

deleteRange

     protected boolean deleteRange(int start,
                                   int end)

  Deletes the text between the specified positions.

  Returns:
    false if the replacement was disallowed
  See Also:
    addTextListener

cancelSelection

     protected void cancelSelection()

  Cancels the current selection.

insert

     public synchronized void insert(String text,
                                     int pos)

  Inserts text at the specified position.

  See Also:
    setText, replaceRange

append

     public void append(String text)

  Appends text to the end. The cursor is moved to the end of the text.

  See Also:
    insert

getStringCase

     public int getStringCase()

  Gets the StringCase value.

  See Also:
    setStringCase

setStringCase

     public void setStringCase(int v)

  Sets the case of text entered by the user or set programmatically:

      CASE_AS_IS       No conversion (default)
      CASE_LOWER       Convert to lower case
      CASE_UPPER       Convert to upper case

  HTML param name/value: "StringCase"/enum

  Throws: IllegalArgumentException
    If an invalid value is set

replaceRange

     public void replaceRange(String str,
                              int start,
                              int end)

  Replaces text from the indicated start to end positions (inclusive) with the new text specified. The text is first converted according to the StringCase value. The JCTextCursorEvent and JCTextEvent events are then posted. The cursor is moved to the end position.

  Parameters:
    text - if null, the current text will be deleted
  See Also:
    insert, setStringCase, addTextCursorListener, addTextListener

replaceTextInternal

     protected void replaceTextInternal(String str,
                                        int start,
                                        int end)

  Updates the internal text buffer.

updateScrollbars

     protected void updateScrollbars()

replace

     protected boolean replace(String text,
                               int start,
                               int end)

  Deletes the text from start to end and then inserts, at start, the text that was passed. The JCTextEvent events are then posted.

  Returns:
    false if the replacement was disallowed
  See Also:
    addTextListener

checkCursorPosition

     protected int checkCursorPosition(int pos)

  Resets the position to the range [0,num_char]

getCursorPosition

     public int getCursorPosition()

  Gets the position of the cursor.

  See Also:
    setCursorPosition

setCursorPosition

     public void setCursorPosition(int pos)

  Sets the position of the cursor, and posts a JCTextCursorEvent event.

  HTML param name/value: "CursorPosition"/int

  Throws: IllegalArgumentException
    If the value is less than 0.
  See Also:
    addTextCursorListener

getCaretPosition

     public int getCaretPosition()

  Gets the position of the cursor (provided for JDK 1.1 compatibility).

  See Also:
    getCursorPosition

setCaretPosition

     public void setCaretPosition(int pos)

  Sets the position of the cursor (provided for JDK 1.1 compatibility).

  See Also:
    setCursorPosition

getShowCursorPosition

     public boolean getShowCursorPosition()

  Gets the ShowCursorPosition value.

  See Also:
    setShowCursorPosition

setShowCursorPosition

     public void setShowCursorPosition(boolean v)

  If set to true (default), the cursor position will be indicated with a vertical I-beam.

  HTML param name/value: "ShowCursorPosition"/boolean

setOverstrike

     public void setOverstrike(boolean v)

  If false (default), characters typed by the user are inserted into the current text.

  HTML param name/value: "Overstrike"/boolean

getOverstrike

     public boolean getOverstrike()

  Gets the Overstrike value.

  See Also:
    setOverstrike

getSelectedText

     public synchronized String getSelectedText()

  Get the selected part of the text.

  See Also:
    select

selectAll

     public void selectAll()

  Selects all the text, and sets the cursor at the last character.

select

     public void select(int start,
                        int end)

  Sets the current selection, and sets the cursor at the end of the selection. If start == end, then the selection is cancelled.

isWordDelimiter

     protected boolean isWordDelimiter(char ch)

  Determines whether a character is a word delimiter.

  Returns:
    false if char is a letter, number, '$' or '_'

isLineDelimiter

     protected boolean isLineDelimiter(char ch)

  Determines whether a character is a line delimiter.

  Returns:
    true if char is a newline or return

select

     protected void select(int start,
                           int end,
                           int type)

  Selects part of the text.

  Parameters:
    type - SELECT_CHAR, SELECT_WORD, SELECT_LINE, or SELECT_ALL

positionToX

     public abstract int positionToX(int pos)

  Gets the x co-ordinate for a character position, ignoring scrolling.

positionToY

     public int positionToY(int pos)

  Gets the y co-ordinate for a character position, ignoring scrolling.

addTextListener

     public void addTextListener(JCTextListener l)

  Adds the specified listener to receive text events.

  See Also:
    JCTextEvent

removeTextListener

     public void removeTextListener(JCTextListener l)

  Removes the specified text listener so it no longer receives text events.

addTextCursorListener

     public void addTextCursorListener(JCTextCursorListener l)

  Adds the specified JCTextCursorEvent listener to receive cursor movement events.

  See Also:
    JCTextCursorEvent

removeTextCursorListener

     public void removeTextCursorListener(JCTextCursorListener l)

  Removes the specified listener so it no longer receives JCTextCursorEvents.

  See Also:
    addTextCursorListener

paintCursor

     protected void paintCursor(boolean state)

  Paints or erases the cursor, depending on the value of state.

run

     public void run()

  Blinks the cursor.

setEditable

     public void setEditable(boolean v)

  If set to true (default), the user can edit the text.

  HTML param name/value: "Editable"/boolean

getSelectedBackground

     public Color getSelectedBackground()

  Gets the SelectedBackground value.

  See Also:
    setSelectedBackground

setSelectedBackground

     public void setSelectedBackground(Color v)

  Sets the background color of selected text (default: blue).

  HTML param name/value: "SelectedBackground"/color

  See Also:
    toColor

getSelectedForeground

     public Color getSelectedForeground()

  Gets the SelectedForeground value.

  See Also:
    setSelectedForeground

setSelectedForeground

     public void setSelectedForeground(Color v)

  Sets the foreground color of selected text (default: background color).

  HTML param name/value: "SelectedForeground"/color

  See Also:
    toColor

getColumns

     public int getColumns()

  Gets the number of columns.

  See Also:
    setColumns

setColumns

     public void setColumns(int v)

  Sets the number of columns.

  HTML param name/value: "Columns"/int

  Throws: IllegalArgumentException
    If the value is less than 0.

getSelectionList

     public int[] getSelectionList()

  Gets the current SelectionList.

  See Also:
    setSelectionList

setSelectionList

     public void setSelectionList(int list[])

  Sets a list of values used for multi-click. As the mouse is clicked in rapid succession, each click selects the next type in the list. Valid values (in order of the default list):

       SELECT_CHAR         Selects the current pointer position
       SELECT_WORD         Selects the current word
       SELECT_LINE         Selects the current line
       SELECT_ALL          Selects all the text

  Default list: { SELECT_CHAR, SELECT_WORD, SELECT_LINE, SELECT_ALL }

getEditable

     public boolean getEditable()

  Gets the Editable value.

  See Also:
    setEditable

isEditable

     public boolean isEditable()

  Gets the Editable value.

  See Also:
    setEditable

showPosition

     public abstract void showPosition(int pos)

  Scrolls the text if necessary to ensure that the position is visible.

  Parameters:
    pos - the number of characters from the beginning of the text buffer.

preferredHeight

     protected int preferredHeight()

  Returns the height of 1 row.

  Overrides:
    preferredHeight in class JCComponent

preferredWidth

     protected int preferredWidth()

  Returns the width of an 'N' times the specified number of columns.

  Overrides:
    preferredWidth in class JCComponent

addNotify

     public void addNotify()

  Creates the peer of the canvas.

  Overrides:
    addNotify in class JCComponent

reshape

     public void reshape(int x,
                         int y,
                         int width,
                         int height)

  Reshapes the Component to the specified bounding box.

  Overrides:
    reshape in class JCComponent

repaint

     public void repaint()

  Overrides Component.repaint(), which does not always call paint().

  Overrides:
    repaint in class JCComponent

pointToPosition

     public abstract int pointToPosition(int x,
                                         int y)

  Converts an x coordinate into a text position. The y value is ignored.

positionToPoint

     protected Point positionToPoint(int pos,
                                     Point p)

  Gets the physical location of a position, ignoring scrolling.

  Parameters:
    p - point (returned if not null)
  Returns:
    the location, or null if p is not null

repaintPositions

     protected void repaintPositions(int start,
                                     int end)

  Draws the text between 2 positions.

repaintPositions

     protected synchronized void repaintPositions(Point p1,
                                                  Point p2)

  Draws the text between 2 points.

beep

     public void beep()

  Emits a beep. For JDK 1.0.2 running in a browser it also flashes it.

pasteFromClipboard

     public boolean pasteFromClipboard(Event ev)

  If the component is editable, inserts the clipboard selection at the current cursor position.

  Returns:
    false if the component is not editable
  See Also:
    readClipboard

writeClipboard

     protected synchronized void writeClipboard(String v)

  Writes to the clipboard.

readClipboard

     protected String readClipboard()

  Gets the clipboard contents.

cutToClipboard

     public void cutToClipboard(Event ev)

  If text is currently selected, copies the selection to the clipboard and deletes it from the component.

  See Also:
    writeClipboard

copyToClipboard

     public void copyToClipboard(Event ev)

  If text is currently selected, copies the selection to the clipboard.

  See Also:
    writeClipboard

getSelectionType

     protected int getSelectionType(int v)

  Gets the selection type corresponding to the index.

  See Also:
    setSelectionList

selectStart

     protected void selectStart(Event ev)

  Starts the selection.

selectExtend

     protected void selectExtend(Event ev)

  Extends the current selection.

selectEnd

     protected void selectEnd(Event ev)

  Ends the current selection.

paste

     protected void paste(Event ev)

  Inserts the current clipboard contents at the event's position, after first deleting any selected text.

  See Also:
    pasteFromClipboard

freeze

     protected void freeze()

unfreeze

     protected void unfreeze()

isFrozen

     protected boolean isFrozen()

mouseDown

     public boolean mouseDown(Event ev,
                              int x,
                              int y)

  Positions the cursor, or if MB2 was pressed, pastes the current clipboard contents.

  Overrides:
    mouseDown in class JCComponent
  See Also:
    pasteFromClipboard, selectStart

mouseDrag

     public boolean mouseDrag(Event ev,
                              int x,
                              int y)

  Selects the text.

  Overrides:
    mouseDrag in class Component
  See Also:
    selectExtend

mouseUp

     public boolean mouseUp(Event ev,
                            int x,
                            int y)

  Ends text selection.

  Overrides:
    mouseUp in class Component
  See Also:
    selectEnd

scrollHome

     protected void scrollHome(Event ev)

  Scrolls to the first line.

scrollEnd

     protected void scrollEnd(Event ev)

  Scrolls to the last line.

scrollLineEnd

     protected void scrollLineEnd(Event ev)

  Scrolls to the end of the current line.

scrollLineBegin

     protected void scrollLineBegin(Event ev)

  Scrolls to the beginning of the current line.

moveForwardChar

     protected void moveForwardChar(Event ev)

  Moves the cursor forward one character. If the Shift key is pressed, the selection is extended.

moveBackwardChar

     protected void moveBackwardChar(Event ev)

  Moves the cursor backward one character. If the Shift key is pressed, the selection is extended.

insertChar

     protected boolean insertChar(Event ev,
                                  int key)

  Inserts a character at the current cursor position.

  Returns:
    false if the component is not editable

deleteChar

     protected boolean deleteChar(Event ev,
                                  boolean current)

  Deletes the current selection; or a character if no text is selected.

  Parameters:
    current - true if the current char should be deleted; otherwise the previous char is deleted
  Returns:
    false if the component is not editable

deletePreviousChar

     protected boolean deletePreviousChar(Event ev)

  Deletes the character before the current cursor position.

  Returns:
    false if the component is not editable

deleteCurrentChar

     protected boolean deleteCurrentChar(Event ev)

  Deletes the character at the current cursor position.

  Returns:
    false if the component is not editable

toggleOverstrike

     protected void toggleOverstrike(Event ev)

  Toggles the value of the overstrike flag.

keyDown

     public boolean keyDown(Event ev,
                            int key)

  Processes keyDown events.

      CTRL/A      scrollHome
      CTRL/D      deleteCurrentChar
      CTRL/E      scrollEnd
      CTRL/O      toggleOverstrike
      CTRL/C      copyToClipboard
      CTRL/X      cutToClipboard
      CTRL/V      pasteFromClipboard
      HOME        scrollHome
      END         scrollEnd
      RIGHT       moveForwardChar
      LEFT        moveBackwardChar
      BS          deletePreviousChar
      DELETE      deleteCurrentChar
      any other   insertChar

  Overrides:
    keyDown in class JCComponent

createPopup

     protected void createPopup(Component comp,
                                int x,
                                int y)

cmpKeyStroke

     protected boolean cmpKeyStroke(String modkey,
                                    int key)

blinkCursor

     protected void blinkCursor(boolean on)

  Enables cursor blinking. No action is taken if the component does not have focus, is not editable, or if the cursor is already blinking. This method is called by gotFocus and lostFocus.

  Parameters:
    on - if true, start cursor blinking; otherwise disable it and don't display the cursor

gotFocus

     public boolean gotFocus(Event ev,
                             Object what)

  Starts the cursor blinking if the component is editable.

  Overrides:
    gotFocus in class JCComponent
  See Also:
    blinkCursor

lostFocus

     public boolean lostFocus(Event ev,
                              Object what)

  Stops the cursor blinking.

  Overrides:
    lostFocus in class JCComponent
  See Also:
    blinkCursor

disable

     public synchronized void disable()

  Disables the component and stops the cursor blinking.

  Overrides:
    disable in class JCComponent

    All Packages  Class Hierarchy  This Package  Previous  Next  Index