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

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

Introduction

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

The text is from its open source code.

Subclass

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

Field

StringHONOR_DISPLAY_PROPERTIES
Key for a client property used to indicate whether the default font and foreground color from the component are used if a font or foreground color is not specified in the styled text.

Constructor

JEditorPane(String type, String text)
Creates a JEditorPane that has been initialized to the given text.
JEditorPane()
Creates a new JEditorPane.
JEditorPane(URL initialPage)
Creates a JEditorPane based on a specified URL for input.
JEditorPane(String url)
Creates a JEditorPane based on a string containing a URL specification.

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.
voidaddNotify()
Notifies this component that it now has a parent component.
voidaddPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
voidcopy()
Transfers the currently selected range in the associated text model to the system clipboard, leaving the contents in the text model.
EditorKitcreateEditorKitForContentType(String type)
Creates a handler for the given type from the default registry of editor kits.
AccessibleContextgetAccessibleContext()
Gets the AccessibleContext associated with this JEditorPane.
ActionMapgetActionMap()
Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding.
ColorgetBackground()
Gets the background color of this component.
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.
StringgetContentType()
Gets the type of content that this editor is currently set to deal with.
DocumentgetDocument()
Fetches the model associated with the editor.
EditorKitgetEditorKit()
Fetches the currently installed kit for handling content.
EditorKitgetEditorKitForContentType(String type)
Fetches the editor kit to use for the given type of content.
FontgetFont()
Gets the font of this component.
FontMetricsgetFontMetrics(Font font)
Gets the FontMetrics for the specified Font.
InputMapgetInputMap()
Returns the InputMap that is used when the component has focus.
StringgetName()
Gets the name of the component.
URLgetPage()
Gets the current URL being displayed.
DimensiongetPreferredSize()
Returns the preferred size for the JEditorPane.
booleangetScrollableTracksViewportHeight()
Returns true if a viewport should always force the height of this Scrollable to match the height of the viewport.
booleangetScrollableTracksViewportWidth()
Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport.
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.
StringgetText()
Returns the text contained in this TextComponent in terms of the content type of this editor.
StringgetToolTipText()
Returns the tooltip string that has been set with setToolTipText.
TransferHandlergetTransferHandler()
Gets the transferHandler property.
TextUIgetUI()
Fetches the user-interface factory for this text-oriented editor.
booleanisEnabled()
Determines whether this component is enabled.
voidpaint(Graphics g)
Invoked by Swing to draw components.
voidpaste()
Transfers the contents of the system clipboard into the associated text model.
voidprint(Graphics g)
Invoke this method to print the component to the specified Graphics.
voidprintAll(Graphics g)
Invoke this method to print the component.
voidputClientProperty(Object key, Object value)
Adds an arbitrary key/value "client property" to this component.
voidread(InputStream in, Object desc)
This method initializes from a stream.
voidread(InputStream in, Document doc)
This method invokes the EditorKit to initiate a read.
voidregisterEditorKitForContentType(String type, String classname, ClassLoader loader)
Establishes the default bindings of type to classname.
voidregisterEditorKitForContentType(String type, String classname)
Establishes the default bindings of type to classname.
voidremoveCaretListener(CaretListener listener)
Removes a caret listener.
voidremoveMouseListener(MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component.
voidremoveMouseMotionListener(MouseMotionListener l)
Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.
voidremovePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list.
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.
voidselect(int selectionStart, int selectionEnd)
Selects the text between the specified start and end positions.
voidsetActionMap(ActionMap am)
Sets the ActionMap to am.
voidsetAlignmentX(float alignmentX)
Sets the horizontal alignment.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetBounds(Rectangle r)
Moves and resizes this component to conform to the new bounding rectangle r .
voidsetCaretPosition(int position)
Sets the position of the text insertion caret for the TextComponent.
voidsetContentType(String type)
Sets the type of content that this editor handles.
voidsetCursor(Cursor cursor)
Sets the cursor image to the specified cursor.
voidsetDisabledTextColor(Color c)
Sets the current color used to render the disabled text.
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.
voidsetEnabled(boolean enabled)
Sets whether or not this component is enabled.
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.
voidsetInputMap(int condition, InputMap map)
Sets the InputMap to use under the condition condition to map.
voidsetMaximumSize(Dimension maximumSize)
Sets the maximum size of this component to a constant value.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
voidsetOpaque(boolean isOpaque)
If true the component paints every pixel within its bounds.
voidsetPage(URL page)
Sets the current URL being displayed.
voidsetPage(String url)
Sets the current URL being displayed.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetSize(int width, int height)
Resizes this component so that it has width width and height height .
voidsetSize(Dimension d)
Resizes this component so that it has width d.width and height d.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.
voidvalidate()
Validates this container and all of its subcomponents.