public abstract class TextWidget extends Widget
Modifier and Type | Method and Description |
---|---|
int |
getCaretPosition()
Get the current position of the caret.
|
javax.swing.text.JTextComponent |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
int |
getLength()
Get the number of characters in the text contained in the Widget.
|
java.lang.String |
getSelectedText()
Get the selected text.
|
int |
getSelectionEnd()
Get the end of the selected range.
|
int |
getSelectionStart()
Get the start of the selected range.
|
java.lang.String |
getText()
Get the text contained in the Widget.
|
boolean |
isEditable()
Determine whether the user can edit the text contained in this text field.
|
void |
setCaretPosition(int pos)
Set the current position of the caret.
|
void |
setEditable(boolean editable)
Set whether the user can edit the text contained in this text field.
|
void |
setSelectionEnd(int pos)
Set the end of the selected range.
|
void |
setSelectionStart(int pos)
Set the start of the selected range.
|
void |
setText(java.lang.String text)
Set the text contained in the Widget.
|
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
addEventLink, addEventLink, removeEventLink
public javax.swing.text.JTextComponent getComponent()
Widget
getComponent
in class Widget
public java.lang.String getText()
public void setText(java.lang.String text)
This method can be safely called from any thread, not just the event dispatch thread.
public int getLength()
public int getCaretPosition()
public void setCaretPosition(int pos)
public int getSelectionStart()
public void setSelectionStart(int pos)
public int getSelectionEnd()
public void setSelectionEnd(int pos)
public java.lang.String getSelectedText()
public boolean isEditable()
public void setEditable(boolean editable)
Written by Peter Eastman.