Java javax.swing JTextPane fields, constructors, methods, implement or subclass

Example usage for Java javax.swing JTextPane fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing JTextPane.

The text is from its open source code.

Subclass

javax.swing.JTextPane has subclasses.
Click this link to see all its subclasses.

Constructor

JTextPane()
Creates a new JTextPane.
JTextPane(StyledDocument doc)
Creates a new JTextPane, with a specified document model.

Method

voidaddCaretListener(CaretListener listener)
Adds a caret listener for notification of any changes to the caret.
voidaddFocusListener(FocusListener l)
Adds the specified focus listener to receive focus events from this component when this component gains input focus.
voidaddHyperlinkListener(HyperlinkListener listener)
Adds a hyperlink listener for notification of any changes, for example when a link is selected and entered.
voidaddKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.
voidaddMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.
voidaddMouseMotionListener(MouseMotionListener l)
Adds the specified mouse motion listener to receive mouse motion events from this component.
StyleaddStyle(String nm, Style parent)
Adds a new style into the logical style hierarchy.
ActionMapgetActionMap()
Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding.
BordergetBorder()
Returns the border of this component or null if no border is currently set.
RectanglegetBounds()
Gets the bounds of this component in the form of a Rectangle object.
CaretgetCaret()
Fetches the caret that allows text-oriented navigation over the view.
intgetCaretPosition()
Returns the position of the text insertion caret for the text component.
ObjectgetClientProperty(Object key)
Returns the value of the property with the specified key.
DocumentgetDocument()
Fetches the model associated with the editor.
EditorKitgetEditorKit()
Fetches the currently installed kit for handling content.
FontgetFont()
Gets the font of this component.
FontMetricsgetFontMetrics(Font font)
Gets the FontMetrics for the specified Font.
HighlightergetHighlighter()
Fetches the object responsible for making highlights.
MutableAttributeSetgetInputAttributes()
Gets the input attributes for the pane.
InputMapgetInputMap()
Returns the InputMap that is used when the component has focus.
InsetsgetInsets()
If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets.
StylegetLogicalStyle()
Fetches the logical style assigned to the paragraph represented by the current position of the caret, or null.
DimensiongetPreferredSize()
Returns the preferred size for the JEditorPane.
StringgetSelectedText()
Returns the selected text contained in this TextComponent.
intgetSelectionEnd()
Returns the selected text's end position.
intgetSelectionStart()
Returns the selected text's start position.
StylegetStyle(String nm)
Fetches a named non-null style previously added.
StyledDocumentgetStyledDocument()
Fetches the model associated with the editor.
StringgetText(int offs, int len)
Fetches a portion of the text represented by the component.
StringgetText()
Returns the text contained in this TextComponent in terms of the content type of this editor.
TextUIgetUI()
Fetches the user-interface factory for this text-oriented editor.
voidinsertComponent(Component c)
Inserts a component into the document as a replacement for the currently selected content.
voidinsertIcon(Icon g)
Inserts an icon into the document as a replacement for the currently selected content.
RectanglemodelToView(int pos)
Converts the given location in the model to a place in the view coordinate system.
booleanprint()
A convenience print method that displays a print dialog, and then prints this JTextComponent in interactive mode with no header or footer text.
booleanprint(final MessageFormat headerFormat, final MessageFormat footerFormat, final boolean showPrintDialog, final PrintService service, final PrintRequestAttributeSet attributes, final boolean interactive)
Prints the content of this JTextComponent .
voidputClientProperty(Object key, Object value)
Adds an arbitrary key/value "client property" to this component.
voidreplaceSelection(String content)
Replaces the currently selected content with new content represented by the given string.
voidrequestFocus()
Requests that this Component gets the input focus.
booleanrequestFocusInWindow()
Requests that this Component gets the input focus.
voidscrollRectToVisible(Rectangle aRect)
Forwards the scrollRectToVisible() message to the JComponent's parent.
voidselectAll()
Selects all the text in the TextComponent.
voidsetAutoscrolls(boolean autoscrolls)
Sets the autoscrolls property.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetBounds(int x, int y, int width, int height)
Moves and resizes this component.
voidsetCaret(Caret c)
Sets the caret to be used.
voidsetCaretPosition(int position)
Sets the position of the text insertion caret for the TextComponent.
voidsetCharacterAttributes(AttributeSet attr, boolean replace)
Applies the given attributes to character content.
voidsetContentType(String type)
Sets the type of content that this editor handles.
voidsetCursor(Cursor cursor)
Sets the cursor image to the specified cursor.
voidsetDocument(Document doc)
Associates the editor with a text document.
voidsetEditable(boolean b)
Sets the specified boolean to indicate whether or not this TextComponent should be editable.
voidsetEditorKit(EditorKit kit)
Sets the currently installed kit for handling content.
voidsetEditorKitForContentType(String type, EditorKit k)
Directly sets the editor kit to use for the given type.
voidsetFocusable(boolean focusable)
Sets the focusable state of this Component to the specified value.
voidsetFont(Font font)
Sets the font for this component.
voidsetForeground(Color fg)
Sets the foreground color of this component.
voidsetHighlighter(Highlighter h)
Sets the highlighter to be used.
voidsetLogicalStyle(Style s)
Sets the logical style to use for the paragraph at the current caret position.
voidsetMargin(Insets m)
Sets margin space between the text component's border and its text.
voidsetName(String name)
Sets the name of the component to the specified string.
voidsetOpaque(boolean isOpaque)
If true the component paints every pixel within its bounds.
voidsetPage(URL page)
Sets the current URL being displayed.
voidsetParagraphAttributes(AttributeSet attr, boolean replace)
Applies the given attributes to paragraphs.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetSelectedTextColor(Color c)
Sets the current color used to render the selected text.
voidsetSize(int width, int height)
Resizes this component so that it has width width and height height .
voidsetText(String t)
Sets the text of this TextComponent to the specified content, which is expected to be in the format of the content type of this editor.
voidsetToolTipText(String text)
Registers the text to display in a tool tip.
voidsetTransferHandler(TransferHandler newHandler)
Sets the TransferHandler , which provides support for transfer of data into and out of this component via cut/copy/paste and drag and drop.
voidsetVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)
Sets the value to indicate whether input verifier for the current focus owner will be called before this component requests focus.
voidsetVisible(boolean aFlag)
Makes the component visible or invisible.
intviewToModel(Point pt)
Converts the given place in the view coordinate system to the nearest representative location in the model.