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 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

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

See Also:
JCTextArea, JCTextField

Variable Index

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

Constructor Index

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

Method Index

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

LEFT (default), CENTER, or RIGHT.

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

HTML param name/value: "Columns"/int

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

HTML param name/value: "CursorPosition"/int

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

HTML param name/value: "Editable"/boolean

 o setFont(Font)
Sets the font of the component.

HTML param name/value: "Font"/font

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

HTML param name/value: "Overstrike"/boolean

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

HTML param name/value: "SelectedBackground"/color

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

HTML param name/value: "SelectedForeground"/color

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

HTML param name/value: "ShowCursorPosition"/boolean

 o 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

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

HTML param name/value: "Text"/string

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

Variables

 o LEFT
  public final static int LEFT
 o CENTER
  public final static int CENTER
 o RIGHT
  public final static int RIGHT
 o CASE_AS_IS
  public final static int CASE_AS_IS
 o CASE_LOWER
  public final static int CASE_LOWER
 o CASE_UPPER
  public final static int CASE_UPPER
 o SELECT_CHAR
  public final static int SELECT_CHAR
 o SELECT_WORD
  public final static int SELECT_WORD
 o SELECT_LINE
  public final static int SELECT_LINE
 o SELECT_PARAGRAPH
  public final static int SELECT_PARAGRAPH
 o SELECT_ALL
  public final static int SELECT_ALL
 o horiz_origin
  protected int horiz_origin
Amount by which the text has been scrolled.

 o vert_origin
  protected int vert_origin
Amount by which the text has been scrolled.

 o cursorListeners
  protected JCVector cursorListeners
List of JCTextCursorEvent listeners.

 o valueListeners
  protected JCVector valueListeners
List of TextEvent/JCTextEvent listeners.

 o cursor_blink_rate
  protected int cursor_blink_rate
Cursor's blink rate (ms)

Constructors

 o JCTextComponent
  public JCTextComponent()
Creates an empty component.

 o 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

Methods

 o 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
 o setFont
  public synchronized void setFont(Font f)
Sets the font of the component.

HTML param name/value: "Font"/font

Overrides:
setFont in class JCComponent
 o getAlignment
  public int getAlignment()
Gets the field's alignment.

See Also:
setAlignment
 o 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
 o getChanged
  public boolean getChanged()
Returns true if the user has changed the value since the last programmatic setting.

 o setChanged
  public void setChanged(boolean v)
Resets the Changed flag.

See Also:
getChanged
 o getLastPosition
  public synchronized 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.

 o getSelectionStart
  public synchronized int getSelectionStart()
Returns the start of the selection.

See Also:
setSelectionStart
 o 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.

 o getSelectionEnd
  public synchronized int getSelectionEnd()
Returns the end of the selection.

See Also:
setSelectionEnd
 o 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.

 o getText
  public synchronized String getText()
Gets the value of the text.

See Also:
setText
 o setText
  public synchronized void setText(String text)
Sets the text of this component to the specified text.

HTML param name/value: "Text"/string

See Also:
getText
 o getNumChar
  public int getNumChar()
Gets the current number of characters.

 o getMaximumLength
  public int getMaximumLength()
Gets the MaximumLength value.

See Also:
setMaximumLength
 o 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
 o deleteSelection
  protected void deleteSelection()
Deletes the current selection.

 o cancelSelection
  protected void cancelSelection()
Cancels the current selection.

 o insert
  public synchronized void insert(String text,
                                  int pos)
Inserts text at the specified position.

See Also:
setText, replaceRange
 o append
  public synchronized void append(String text)
Appends text to the end. The cursor is moved to the end of the text.

See Also:
insert
 o getStringCase
  public int getStringCase()
Gets the StringCase value.

See Also:
setStringCase
 o 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
 o 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
 o replaceTextInternal
  protected synchronized void replaceTextInternal(String str,
                                                  int start,
                                                  int end)
Updates the internal text buffer.

 o updateScrollbars
  protected void updateScrollbars()
 o 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
 o checkCursorPosition
  protected int checkCursorPosition(int pos)
Resets the position to the range [0,num_char]

 o getCursorPosition
  public int getCursorPosition()
Gets the position of the cursor.

See Also:
setCursorPosition
 o 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
 o getCaretPosition
  public int getCaretPosition()
Gets the position of the cursor (provided for JDK 1.1 compatibility).

See Also:
getCursorPosition
 o setCaretPosition
  public void setCaretPosition(int pos)
Sets the position of the cursor (provided for JDK 1.1 compatibility).

See Also:
setCursorPosition
 o getShowCursorPosition
  public boolean getShowCursorPosition()
Gets the ShowCursorPosition value.

See Also:
setShowCursorPosition
 o 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

 o 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

 o getOverstrike
  public boolean getOverstrike()
Gets the Overstrike value.

See Also:
setOverstrike
 o getSelectedText
  public synchronized String getSelectedText()
Get the selected part of the text.

See Also:
select
 o selectAll
  public synchronized void selectAll()
Selects all the text, and sets the cursor at the last character.

 o select
  public synchronized 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.

 o isWordDelimiter
  protected boolean isWordDelimiter(char ch)
Determines whether a character is a word delimiter.

Returns:
false if char is a letter, number, '$' or '_'
 o isLineDelimiter
  protected boolean isLineDelimiter(char ch)
Determines whether a character is a line delimiter.

Returns:
true if char is a newline or return
 o 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
 o positionToX
  public abstract int positionToX(int pos)
Gets the x co-ordinate for a character position, ignoring scrolling.

 o positionToY
  public int positionToY(int pos)
Gets the y co-ordinate for a character position, ignoring scrolling.

 o addTextListener
  public void addTextListener(JCTextListener l)
Adds the specified listener to receive text events.

See Also:
JCTextEvent
 o removeTextListener
  public void removeTextListener(JCTextListener l)
Removes the specified text listener so it no longer receives text events.

 o addTextCursorListener
  public void addTextCursorListener(JCTextCursorListener l)
Adds the specified JCTextCursorEvent listener to receive cursor movement events.

See Also:
JCTextCursorEvent
 o removeTextCursorListener
  public void removeTextCursorListener(JCTextCursorListener l)
Removes the specified listener so it no longer receives JCTextCursorEvents.

See Also:
addTextCursorListener
 o paintCursor
  protected void paintCursor(boolean state)
Paints or erases the cursor, depending on the value of state.

 o run
  public void run()
Blinks the cursor.

 o setEditable
  public synchronized void setEditable(boolean v)
If set to true (default), the user can edit the text.

HTML param name/value: "Editable"/boolean

 o getSelectedBackground
  public Color getSelectedBackground()
Gets the SelectedBackground value.

See Also:
setSelectedBackground
 o setSelectedBackground
  public void setSelectedBackground(Color v)
Sets the background color of selected text (default: blue).

HTML param name/value: "SelectedBackground"/color

See Also:
toColor
 o getSelectedForeground
  public Color getSelectedForeground()
Gets the SelectedForeground value.

See Also:
setSelectedForeground
 o 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
 o getColumns
  public int getColumns()
Gets the number of columns.

See Also:
setColumns
 o 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.
 o getSelectionList
  public int[] getSelectionList()
Gets the current SelectionList.

See Also:
setSelectionList
 o 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 }

 o getEditable
  public boolean getEditable()
Gets the Editable value.

See Also:
setEditable
 o isEditable
  public boolean isEditable()
Gets the Editable value.

See Also:
setEditable
 o 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.
 o preferredHeight
  protected int preferredHeight()
Returns the height of 1 row.

Overrides:
preferredHeight in class JCComponent
 o preferredWidth
  protected int preferredWidth()
Returns the width of an 'N' times the specified number of columns.

Overrides:
preferredWidth in class JCComponent
 o addNotify
  public void addNotify()
Creates the peer of the canvas.

Overrides:
addNotify in class JCComponent
 o reshape
  public synchronized void reshape(int x,
                                   int y,
                                   int width,
                                   int height)
Reshapes the Component to the specified bounding box.

Overrides:
reshape in class JCComponent
 o repaint
  public void repaint()
Overrides Component.repaint(), which does not always call paint().

Overrides:
repaint in class JCComponent
 o pointToPosition
  public abstract int pointToPosition(int x,
                                      int y)
Converts an x coordinate into a text position. The y value is ignored.

 o 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
 o repaintPositions
  protected synchronized void repaintPositions(int start,
                                               int end)
Draws the text between 2 positions.

 o repaintPositions
  protected synchronized void repaintPositions(Point p1,
                                               Point p2)
Draws the text between 2 points.

 o beep
  public void beep()
Emits a beep. For JDK 1.0.2 running in a browser it also flashes it.

 o 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
 o writeClipboard
  protected synchronized void writeClipboard(String v)
Writes to the clipboard.

 o readClipboard
  protected String readClipboard()
Gets the clipboard contents.

 o 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
 o copyToClipboard
  public void copyToClipboard(Event ev)
If text is currently selected, copies the selection to the clipboard.

See Also:
writeClipboard
 o getSelectionType
  protected int getSelectionType(int v)
Gets the selection type corresponding to the index.

See Also:
setSelectionList
 o selectStart
  protected void selectStart(Event ev)
Starts the selection.

 o selectExtend
  protected void selectExtend(Event ev)
Extends the current selection.

 o selectEnd
  protected void selectEnd(Event ev)
Ends the current selection.

 o 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
 o freeze
  protected void freeze()
 o unfreeze
  protected void unfreeze()
 o isFrozen
  protected boolean isFrozen()
 o 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
 o mouseDrag
  public boolean mouseDrag(Event ev,
                           int x,
                           int y)
Selects the text.

Overrides:
mouseDrag in class Component
See Also:
selectExtend
 o mouseUp
  public boolean mouseUp(Event ev,
                         int x,
                         int y)
Ends text selection.

Overrides:
mouseUp in class Component
See Also:
selectEnd
 o scrollHome
  protected void scrollHome(Event ev)
Scrolls to the first line.

 o scrollEnd
  protected void scrollEnd(Event ev)
Scrolls to the last line.

 o scrollLineEnd
  protected void scrollLineEnd(Event ev)
Scrolls to the end of the current line.

 o scrollLineBegin
  protected void scrollLineBegin(Event ev)
Scrolls to the beginning of the current line.

 o moveForwardChar
  protected void moveForwardChar(Event ev)
Moves the cursor forward one character. If the Shift key is pressed, the selection is extended.

 o moveBackwardChar
  protected void moveBackwardChar(Event ev)
Moves the cursor backward one character. If the Shift key is pressed, the selection is extended.

 o insertChar
  protected boolean insertChar(Event ev,
                               int key)
Inserts a character at the current cursor position.

Returns:
false if the insertion was disallowed
 o deletePreviousChar
  protected boolean deletePreviousChar(Event ev)
Deletes the character before the current cursor position.

Returns:
false if the deletion was disallowed
 o deleteCurrentChar
  protected boolean deleteCurrentChar(Event ev)
Deletes the character at the current cursor position.

Returns:
false if the deletion was disallowed
 o toggleOverstrike
  protected void toggleOverstrike(Event ev)
Toggles the value of the overstrike flag.

 o 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 Component
 o 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
 o 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
 o lostFocus
  public boolean lostFocus(Event ev,
                           Object what)
Stops the cursor blinking.

Overrides:
lostFocus in class JCComponent
See Also:
blinkCursor
 o 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