javax.swing.text
Class JTextComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
Direct Known Subclasses:
JEditorPane, JTextArea, JTextField

public abstract class JTextComponent
extends JComponent
implements Scrollable, Accessible

See Also:
Serialized Form

Nested Class Summary
 class JTextComponent.AccessibleJTextComponent
          AccessibleJTextComponent implements accessibility hooks for JTextComponent.
static class JTextComponent.KeyBinding
           
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String DEFAULT_KEYMAP
           
static String FOCUS_ACCELERATOR_KEY
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JTextComponent()
          Creates a new JTextComponent instance.
 
Method Summary
 void addCaretListener(CaretListener listener)
          Adds a CaretListener object to this text component.
 void addInputMethodListener(InputMethodListener listener)
          Adds an InputListener object to this text component.
static Keymap addKeymap(String n, Keymap parent)
          Create a new Keymap with a specific name and parent, and add the new Keymap to the global keymap table.
 void copy()
           
 void cut()
           
protected  void fireCaretUpdate(CaretEvent event)
          Notifies all registered CaretListener objects that the caret was updated.
 AccessibleContext getAccessibleContext()
          Get the AccessibleContext of this object.
 Action[] getActions()
          Returns the set of available Actions this component's associated editor can run.
 Caret getCaret()
          The Caret object used in this text component.
 Color getCaretColor()
           
 CaretListener[] getCaretListeners()
          Returns all added CaretListener objects.
 int getCaretPosition()
          Retrisves the current caret position.
 Color getDisabledTextColor()
           
 Document getDocument()
           
 boolean getDragEnabled()
           
 char getFocusAccelerator()
           
 Highlighter getHighlighter()
           
 InputMethodListener[] getInputMethodListeners()
          Returns all added InputMethodListener objects.
 Keymap getKeymap()
          Get the current Keymap of this component.
static Keymap getKeymap(String n)
          Get a Keymap from the global keymap table, by name.
 Insets getMargin()
           
 NavigationFilter getNavigationFilter()
           
 Dimension getPreferredScrollableViewportSize()
           
 int getScrollableBlockIncrement(Rectangle visible, int orientation, int direction)
          Return the preferred scrolling amount (in pixels) for the given scrolling direction and orientation when scrolling in large amounts (pages).
 boolean getScrollableTracksViewportHeight()
          Return true if the height of the scrollable is always equal to the view, where it is displayed, height.In such case, the vertical scrolling should not be performed.
 boolean getScrollableTracksViewportWidth()
          Return true if the width of the scrollable is always equal to the view, where it is displayed, width (for instance, the text area with the word wrap).
 int getScrollableUnitIncrement(Rectangle visible, int orientation, int direction)
          Return the preferred scrolling amount (in pixels) for the given scrolling direction and orientation when scrolling in small amounts like table lines.
 String getSelectedText()
          Retrieves the currently selected text in this text document.
 Color getSelectedTextColor()
           
 Color getSelectionColor()
           
 int getSelectionEnd()
          Returns the end postion of the currently selected text.
 int getSelectionStart()
          Returns the start postion of the currently selected text.
 String getText()
          Retrieves the current text in this text document.
 String getText(int offset, int length)
          Retrieves a part of the current text in this document.
 String getToolTipText(MouseEvent ev)
          Returns the tooltip text for this text component for the given mouse event.
 TextUI getUI()
          This method returns the label's UI delegate.
 String getUIClassID()
          Returns a string that specifies the name of the Look and Feel class that renders this component.
 boolean isEditable()
          Checks whether this text component it editable.
static void loadKeymap(Keymap map, JTextComponent.KeyBinding[] bindings, Action[] actions)
          Resolves a set of bindings against a set of actions and inserts the results into a Keymap.
 Rectangle modelToView(int position)
           
 void moveCaretPosition(int position)
          Moves the caret to a given position.
protected  String paramString()
          Returns a string representation of this JTextComponent.
 void paste()
           
 void read(Reader input, Object streamDescription)
          Read and set the content this component.
 void removeCaretListener(CaretListener listener)
          Removed a CaretListener object from this text component.
 void removeInputMethodListener(InputMethodListener listener)
          Removes an InputListener object from this text component.
static Keymap removeKeymap(String n)
          Remove a Keymap from the global Keymap table, by name.
 void replaceSelection(String content)
           
 void select(int start, int end)
          Selects a part of the content of the text component.
 void selectAll()
          Selects the whole content of the text component.
 void setCaret(Caret newCaret)
          Sets a new Caret for this text component.
 void setCaretColor(Color newColor)
           
 void setCaretPosition(int position)
          Sets the caret to a new position.
 void setDisabledTextColor(Color newColor)
           
 void setDocument(Document newDoc)
           
 void setDragEnabled(boolean enabled)
           
 void setEditable(boolean newValue)
          Enables/disabled this text component's editability.
 void setFocusAccelerator(char newKey)
           
 void setHighlighter(Highlighter newHighlighter)
           
 void setKeymap(Keymap k)
          Set the current Keymap of this component, installing appropriate KeymapWrapper and KeymapActionMap objects in the InputMap and ActionMap parent chains, respectively, and fire a property change event with name "keymap".
 void setMargin(Insets m)
           
 void setNavigationFilter(NavigationFilter filter)
           
 void setSelectedTextColor(Color newColor)
           
 void setSelectionColor(Color newColor)
           
 void setSelectionEnd(int end)
          Selects the text from the selection start postion to the given position.
 void setSelectionStart(int start)
          Selects the text from the given postion to the selection end position.
 void setText(String text)
           
 void setUI(TextUI newUI)
          This method sets the label's UI delegate.
 void updateUI()
          This method resets the label's UI delegate to the default UI for the current look and feel.
 int viewToModel(Point pt)
           
 void write(Writer output)
          Write the content of this component to the given stream.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_KEYMAP

public static final String DEFAULT_KEYMAP
See Also:
Constant Field Values

FOCUS_ACCELERATOR_KEY

public static final String FOCUS_ACCELERATOR_KEY
See Also:
Constant Field Values
Constructor Detail

JTextComponent

public JTextComponent()
Creates a new JTextComponent instance.

Method Detail

getKeymap

public static Keymap getKeymap(String n)
Get a Keymap from the global keymap table, by name.

Parameters:
n - The name of the Keymap to look up
Returns:
A Keymap associated with the provided name, or null if no such Keymap exists
See Also:
addKeymap(java.lang.String, javax.swing.text.Keymap), removeKeymap(java.lang.String), keymaps

removeKeymap

public static Keymap removeKeymap(String n)
Remove a Keymap from the global Keymap table, by name.

Parameters:
n - The name of the Keymap to remove
Returns:
The keymap removed from the global table
See Also:
addKeymap(java.lang.String, javax.swing.text.Keymap), getKeymap(), keymaps

addKeymap

public static Keymap addKeymap(String n,
                               Keymap parent)
Create a new Keymap with a specific name and parent, and add the new Keymap to the global keymap table. The name may be null, in which case the new Keymap will not be added to the global Keymap table. The parent may also be null, which is harmless.

Parameters:
n - The name of the new Keymap, or null
parent - The parent of the new Keymap, or null
Returns:
The newly created Keymap
See Also:
removeKeymap(java.lang.String), getKeymap(), keymaps

getKeymap

public Keymap getKeymap()
Get the current Keymap of this component.

Returns:
The component's current Keymap
See Also:
setKeymap(javax.swing.text.Keymap), keymap

setKeymap

public void setKeymap(Keymap k)
Set the current Keymap of this component, installing appropriate KeymapWrapper and KeymapActionMap objects in the InputMap and ActionMap parent chains, respectively, and fire a property change event with name "keymap".

See Also:
getKeymap(), keymap

loadKeymap

public static void loadKeymap(Keymap map,
                              JTextComponent.KeyBinding[] bindings,
                              Action[] actions)
Resolves a set of bindings against a set of actions and inserts the results into a Keymap. Specifically, for each provided binding b, if there exists a provided action a such that a.getValue(Action.NAME) == b.ActionName then an entry is added to the Keymap mapping b to a.

Parameters:
map - The Keymap to add new mappings to
bindings - The set of bindings to add to the Keymap
actions - The set of actions to resolve binding names against
See Also:
Action.NAME, Action.getValue(java.lang.String), JTextComponent.KeyBinding.actionName

getActions

public Action[] getActions()
Returns the set of available Actions this component's associated editor can run. Equivalent to calling getUI().getEditorKit().getActions(). This set of Actions is a reasonable value to provide as a parameter to loadKeymap(javax.swing.text.Keymap, javax.swing.text.JTextComponent.KeyBinding[], javax.swing.Action[]), when resolving a set of JTextComponent.KeyBinding objects against this component.

Returns:
The set of available Actions on this component's EditorKit
See Also:
TextUI.getEditorKit(javax.swing.text.JTextComponent), EditorKit.getActions()

setDocument

public void setDocument(Document newDoc)

getDocument

public Document getDocument()

getAccessibleContext

public AccessibleContext getAccessibleContext()
Get the AccessibleContext of this object.

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
an AccessibleContext object

setMargin

public void setMargin(Insets m)

getMargin

public Insets getMargin()

setText

public void setText(String text)

getText

public String getText()
Retrieves the current text in this text document.

Returns:
the text
Throws:
NullPointerException - if the underlaying document is null

getText

public String getText(int offset,
                      int length)
               throws BadLocationException
Retrieves a part of the current text in this document.

Parameters:
offset - the postion of the first character
length - the length of the text to retrieve
Returns:
the text
Throws:
BadLocationException - if arguments do not hold pre-conditions

getSelectedText

public String getSelectedText()
Retrieves the currently selected text in this text document.

Returns:
the selected text
Throws:
NullPointerException - if the underlaying document is null

getUIClassID

public String getUIClassID()
Returns a string that specifies the name of the Look and Feel class that renders this component.

Overrides:
getUIClassID in class JComponent
Returns:
the string "TextComponentUI"
See Also:
JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

paramString

protected String paramString()
Returns a string representation of this JTextComponent.

Overrides:
paramString in class JComponent
Returns:
A string describing this component.

getUI

public TextUI getUI()
This method returns the label's UI delegate.

Returns:
The label's UI delegate.

setUI

public void setUI(TextUI newUI)
This method sets the label's UI delegate.

Parameters:
newUI - The label's UI delegate.

updateUI

public void updateUI()
This method resets the label's UI delegate to the default UI for the current look and feel.

Overrides:
updateUI in class JComponent

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visible,
                                      int orientation,
                                      int direction)
Description copied from interface: Scrollable
Return the preferred scrolling amount (in pixels) for the given scrolling direction and orientation when scrolling in small amounts like table lines.

Specified by:
getScrollableUnitIncrement in interface Scrollable
Parameters:
visible - the currently visible part of the component.
orientation - the scrolling orientation
direction - the scrolling direction (negative - up, positive -down). The values greater than one means that more mouse wheel or similar events were generated, and hence it is better to scroll the longer distance.
Returns:
the preferred scrolling distance, negative if up or left.

getScrollableBlockIncrement

public int getScrollableBlockIncrement(Rectangle visible,
                                       int orientation,
                                       int direction)
Description copied from interface: Scrollable
Return the preferred scrolling amount (in pixels) for the given scrolling direction and orientation when scrolling in large amounts (pages).

Specified by:
getScrollableBlockIncrement in interface Scrollable
Parameters:
visible - the currently visible part of the component.
orientation - the scrolling orientation
direction - the scrolling direction (negative - up, positive -down). The values greater than one means that more mouse wheel or similar events were generated, and hence it is better to scroll the longer distance.
Returns:
the preferred scrolling distance, negative if up or left.

isEditable

public boolean isEditable()
Checks whether this text component it editable.

Returns:
true if editable, false otherwise

setEditable

public void setEditable(boolean newValue)
Enables/disabled this text component's editability.

Parameters:
newValue - true to make it editable, false otherwise.

getCaret

public Caret getCaret()
The Caret object used in this text component.

Returns:
the caret object

setCaret

public void setCaret(Caret newCaret)
Sets a new Caret for this text component.

Parameters:
newCaret - the new Caret to set

getCaretColor

public Color getCaretColor()

setCaretColor

public void setCaretColor(Color newColor)

getDisabledTextColor

public Color getDisabledTextColor()

setDisabledTextColor

public void setDisabledTextColor(Color newColor)

getSelectedTextColor

public Color getSelectedTextColor()

setSelectedTextColor

public void setSelectedTextColor(Color newColor)

getSelectionColor

public Color getSelectionColor()

setSelectionColor

public void setSelectionColor(Color newColor)

getCaretPosition

public int getCaretPosition()
Retrisves the current caret position.

Returns:
the current position

setCaretPosition

public void setCaretPosition(int position)
Sets the caret to a new position.

Parameters:
position - the new position

moveCaretPosition

public void moveCaretPosition(int position)
Moves the caret to a given position. This selects the text between the old and the new position of the caret.


getHighlighter

public Highlighter getHighlighter()

setHighlighter

public void setHighlighter(Highlighter newHighlighter)

getSelectionStart

public int getSelectionStart()
Returns the start postion of the currently selected text.

Returns:
the start postion

setSelectionStart

public void setSelectionStart(int start)
Selects the text from the given postion to the selection end position.

Parameters:
start - the start positon of the selected text.

getSelectionEnd

public int getSelectionEnd()
Returns the end postion of the currently selected text.

Returns:
the end postion

setSelectionEnd

public void setSelectionEnd(int end)
Selects the text from the selection start postion to the given position.

Parameters:
end - the end positon of the selected text.

select

public void select(int start,
                   int end)
Selects a part of the content of the text component.

Parameters:
start - the start position of the selected text
end - the end position of the selected text

selectAll

public void selectAll()
Selects the whole content of the text component.


replaceSelection

public void replaceSelection(String content)

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Description copied from interface: Scrollable
Return true if the height of the scrollable is always equal to the view, where it is displayed, height.In such case, the vertical scrolling should not be performed.

Specified by:
getScrollableTracksViewportHeight in interface Scrollable
Returns:
true is no horizontal scrolling is assumed, faster otherwise.

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Description copied from interface: Scrollable
Return true if the width of the scrollable is always equal to the view, where it is displayed, width (for instance, the text area with the word wrap). In such case, the horizontal scrolling should not be performed.

Specified by:
getScrollableTracksViewportWidth in interface Scrollable
Returns:
true is no horizontal scrolling is assumed, faster otherwise.

addCaretListener

public void addCaretListener(CaretListener listener)
Adds a CaretListener object to this text component.

Parameters:
listener - the listener to add

removeCaretListener

public void removeCaretListener(CaretListener listener)
Removed a CaretListener object from this text component.

Parameters:
listener - the listener to remove

getCaretListeners

public CaretListener[] getCaretListeners()
Returns all added CaretListener objects.

Returns:
an array of listeners

fireCaretUpdate

protected void fireCaretUpdate(CaretEvent event)
Notifies all registered CaretListener objects that the caret was updated.

Parameters:
event - the event to send

addInputMethodListener

public void addInputMethodListener(InputMethodListener listener)
Adds an InputListener object to this text component.

Overrides:
addInputMethodListener in class Component
Parameters:
listener - the listener to add
See Also:
InputMethodEvent, Component.removeInputMethodListener(InputMethodListener), Component.getInputMethodListeners(), Component.getInputMethodRequests()

removeInputMethodListener

public void removeInputMethodListener(InputMethodListener listener)
Removes an InputListener object from this text component.

Overrides:
removeInputMethodListener in class Component
Parameters:
listener - the listener to remove
See Also:
InputMethodEvent, Component.addInputMethodListener(InputMethodListener), Component.getInputMethodRequests()

getInputMethodListeners

public InputMethodListener[] getInputMethodListeners()
Returns all added InputMethodListener objects.

Overrides:
getInputMethodListeners in class Component
Returns:
an array of listeners
See Also:
Component.addInputMethodListener(InputMethodListener), Component.removeInputMethodListener(InputMethodListener)

modelToView

public Rectangle modelToView(int position)
                      throws BadLocationException
Throws:
BadLocationException

getDragEnabled

public boolean getDragEnabled()

setDragEnabled

public void setDragEnabled(boolean enabled)

viewToModel

public int viewToModel(Point pt)

copy

public void copy()

cut

public void cut()

paste

public void paste()

setFocusAccelerator

public void setFocusAccelerator(char newKey)

getFocusAccelerator

public char getFocusAccelerator()

getNavigationFilter

public NavigationFilter getNavigationFilter()
Since:
1.4

setNavigationFilter

public void setNavigationFilter(NavigationFilter filter)
Since:
1.4

read

public void read(Reader input,
                 Object streamDescription)
          throws IOException
Read and set the content this component. If not overridden, the method reads the component content as a plain text. The second parameter of this method describes the input stream. It can be String, URL, File and so on. If not null, this object is added to the properties of the associated document under the key Document.StreamDescriptionProperty.

Parameters:
input - an input stream to read from.
streamDescription - an object, describing the stream.
Throws:
IOException - if the reader throws it.
See Also:
getDocument(), Document.getProperty(Object)

write

public void write(Writer output)
           throws IOException
Write the content of this component to the given stream. If not overridden, the method writes the component content as a plain text.

Parameters:
output - the writer to write into.
Throws:
IOException - if the writer throws it.

getToolTipText

public String getToolTipText(MouseEvent ev)
Returns the tooltip text for this text component for the given mouse event. This forwards the call to TextUI.getToolTipText(JTextComponent, Point).

Overrides:
getToolTipText in class JComponent
Parameters:
ev - the mouse event
Returns:
the tooltip text for this text component for the given mouse event
See Also:
JComponent.setToolTipText(java.lang.String), JComponent.getToolTipText()