Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
charva.awt.Component
charvax.swing.JComponent
charvax.swing.text.JTextComponent
charvax.swing.JTextArea
Field Summary |
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 | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT , _alignmentX , _alignmentY , _background , _cursesColor , _enabled , _focusListeners , _foreground , _keyListeners , _origin , _parent , _visible |
Constructor Summary | |
| |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
int |
|
int | |
int |
|
int |
|
int |
|
int |
|
boolean |
|
Dimension |
|
int |
|
Dimension |
|
int |
|
boolean |
|
void |
|
Dimension |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class charvax.swing.text.JTextComponent | |
getCaretPosition , getDocument , getText , isEditable , setCaretPosition , setDocument , setEditable , setText |
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 , setEnabled , setForeground , setLocation , setLocation , setName , setParent , setVisible , show , validate , validateCursesColor |
public JTextArea()
The default constructor creates an empty text area with 10 rows and 10 columns.
public JTextArea(String text_)
Construct a text area with 10 rows and 10 columns, and containing the specified text.
public JTextArea(String text_, int rows_, int columns_)
Construct a text area wth the specified number of rows and columns, and containing the specified text.
public void addScrollListener(ScrollListener sl_)
Register a ScrollListener object for this JTextArea.
- Specified by:
- addScrollListener in interface Scrollable
public void append(String text_)
Appends the specified text to the end of the document.
public void draw()
Implements the abstract method in charva.awt.Component.
- Overrides:
- draw in interface JComponent
public int getColumns()
Returns the number of columns in this JTextArea.
public int getLineCount()
Returns the number of lines of text displayed in the JTextArea.
public int getLineEndOffset(int line_)
Returns the offset of the last character in the specified line.
public int getLineOfOffset(int offset_)
Translates an offset (relative to the start of the document) to a line number.
public int getLineStartOffset(int line_)
Returns the offset of the first character in the specified line of text.
public boolean getLineWrap()
Returns the line-wrapping policy of the JTextArea. If set to true, lines will be wrapped if they are too long to fit within the allocated width. If set to false, the lines will always be unwrapped.
public Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this JTextArea when it is in a JScrollPane (this method implements the Scrollable interface). The size is determined by the number of rows and columns set for this JTextArea (either in the constructor or in the setColumns() and setRows() methods).
- Specified by:
- getPreferredScrollableViewportSize in interface Scrollable
public int getRows()
Returns the number of rows in this JTextArea.
public boolean getWrapStyleWord()
Returns the line-wrapping style to be used if getLineWrap() is true. If true, lines will be wrapped at word boundaries (whitespace) if they are too long to fit in the allocated number of columns. If false, lines will be wrapped at character boundaries.
public void insert(String text_, int pos_)
Inserts the specified text at the specified position (ie at the specified offset from the start of the document)..
public Dimension minimumSize()
Called by the LayoutManager.
- Overrides:
- minimumSize in interface Component
public void processKeyEvent(KeyEvent ke_)
Process KeyEvents that have been generated by this JTextArea.
- Overrides:
- processKeyEvent in interface Component
public void processMouseEvent(MouseEvent e_)
Process a MouseEvent that was generated by clicking the mouse somewhere inside this JTextArea. Clicking the mouse inside the JTextArea moves the caret position to where the mouse was clicked.
- Overrides:
- processMouseEvent in interface Component
public void processScrollEvent(ScrollEvent e_)
Process scroll events generated by this JTextArea.
- Specified by:
- processScrollEvent in interface Scrollable
public void removeScrollListener(ScrollListener sl_)
Remove a ScrollListener object that is registered for this JTextArea.
- Specified by:
- removeScrollListener in interface Scrollable
public void replaceRange(String text_, int start_, int end_)
Replaces the text from the specified start position to end position with the specified text.
public 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.
- Overrides:
- requestFocus in interface Component
public void setCaretPosition(int caret_)
Sets the position of the text insertion caret for this JTextArea.
- Overrides:
- setCaretPosition in interface JTextComponent
public void setColumns(int columns_)
Sets the number of columns in this JTextArea.
public void setLineWrap(boolean wrap_)
Sets the line-wrapping policy of the JTextArea. If set to true, lines will be wrapped if they are too long to fit within the allocated width. If set to false, the lines will always be unwrapped. The default value of this property is false.
public void setRows(int rows_)
Sets the number of rows in this JTextArea.
public void setWrapStyleWord(boolean wrapWord_)
Sets the line-wrapping style to be used if getLineWrap() is true. If true, lines will be wrapped at word boundaries (whitespace) if they are too long to fit in the allocated number of columns. If false, lines will be wrapped at character boundaries. The default value of this property is false.