Example usage for Java javax.swing JEditorPane fields, constructors, methods, implement or subclass
The text is from its open source code.
String | HONOR_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. |
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. |
void | addCaretListener(CaretListener listener) Adds a caret listener for notification of any changes to the caret. |
void | addFocusListener(FocusListener l) Adds the specified focus listener to receive focus events from this component when this component gains input focus. |
void | addHyperlinkListener(HyperlinkListener listener) Adds a hyperlink listener for notification of any changes, for example when a link is selected and entered. |
void | addKeyListener(KeyListener l) Adds the specified key listener to receive key events from this component. |
void | addMouseListener(MouseListener l) Adds the specified mouse listener to receive mouse events from this component. |
void | addMouseMotionListener(MouseMotionListener l) Adds the specified mouse motion listener to receive mouse motion events from this component. |
void | addNotify() Notifies this component that it now has a parent component. |
void | addPropertyChangeListener(PropertyChangeListener listener) Adds a PropertyChangeListener to the listener list. |
void | copy() Transfers the currently selected range in the associated text model to the system clipboard, leaving the contents in the text model. |
EditorKit | createEditorKitForContentType(String type) Creates a handler for the given type from the default registry of editor kits. |
AccessibleContext | getAccessibleContext() Gets the AccessibleContext associated with this JEditorPane. |
ActionMap | getActionMap() Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding. |
Color | getBackground() Gets the background color of this component. |
Caret | getCaret() Fetches the caret that allows text-oriented navigation over the view. |
int | getCaretPosition() Returns the position of the text insertion caret for the text component. |
Object | getClientProperty(Object key) Returns the value of the property with the specified key. |
String | getContentType() Gets the type of content that this editor is currently set to deal with. |
Document | getDocument() Fetches the model associated with the editor. |
EditorKit | getEditorKit() Fetches the currently installed kit for handling content. |
EditorKit | getEditorKitForContentType(String type) Fetches the editor kit to use for the given type of content. |
Font | getFont() Gets the font of this component. |
FontMetrics | getFontMetrics(Font font) Gets the FontMetrics for the specified Font . |
InputMap | getInputMap() Returns the InputMap that is used when the component has focus. |
String | getName() Gets the name of the component. |
URL | getPage() Gets the current URL being displayed. |
Dimension | getPreferredSize() Returns the preferred size for the JEditorPane . |
boolean | getScrollableTracksViewportHeight() Returns true if a viewport should always force the height of this Scrollable to match the height of the viewport. |
boolean | getScrollableTracksViewportWidth() Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport. |
String | getSelectedText() Returns the selected text contained in this TextComponent . |
int | getSelectionEnd() Returns the selected text's end position. |
int | getSelectionStart() Returns the selected text's start position. |
String | getText() Returns the text contained in this TextComponent in terms of the content type of this editor. |
String | getToolTipText() Returns the tooltip string that has been set with setToolTipText . |
TransferHandler | getTransferHandler() Gets the transferHandler property. |
TextUI | getUI() Fetches the user-interface factory for this text-oriented editor. |
boolean | isEnabled() Determines whether this component is enabled. |
void | paint(Graphics g) Invoked by Swing to draw components. |
void | paste() Transfers the contents of the system clipboard into the associated text model. |
void | print(Graphics g) Invoke this method to print the component to the specified Graphics . |
void | printAll(Graphics g) Invoke this method to print the component. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to this component. |
void | read(InputStream in, Object desc) This method initializes from a stream. |
void | read(InputStream in, Document doc) This method invokes the EditorKit to initiate a read. |
void | registerEditorKitForContentType(String type, String classname, ClassLoader loader) Establishes the default bindings of type to classname . |
void | registerEditorKitForContentType(String type, String classname) Establishes the default bindings of type to classname . |
void | removeCaretListener(CaretListener listener) Removes a caret listener. |
void | removeMouseListener(MouseListener l) Removes the specified mouse listener so that it no longer receives mouse events from this component. |
void | removeMouseMotionListener(MouseMotionListener l) Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component. |
void | removePropertyChangeListener(PropertyChangeListener listener) Removes a PropertyChangeListener from the listener list. |
void | requestFocus() Requests that this Component gets the input focus. |
boolean | requestFocusInWindow() Requests that this Component gets the input focus. |
void | scrollRectToVisible(Rectangle aRect) Forwards the scrollRectToVisible() message to the JComponent 's parent. |
void | select(int selectionStart, int selectionEnd) Selects the text between the specified start and end positions. |
void | setActionMap(ActionMap am) Sets the ActionMap to am . |
void | setAlignmentX(float alignmentX) Sets the horizontal alignment. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setBounds(Rectangle r) Moves and resizes this component to conform to the new bounding rectangle r . |
void | setCaretPosition(int position) Sets the position of the text insertion caret for the TextComponent . |
void | setContentType(String type) Sets the type of content that this editor handles. |
void | setCursor(Cursor cursor) Sets the cursor image to the specified cursor. |
void | setDisabledTextColor(Color c) Sets the current color used to render the disabled text. |
void | setDocument(Document doc) Associates the editor with a text document. |
void | setEditable(boolean b) Sets the specified boolean to indicate whether or not this TextComponent should be editable. |
void | setEditorKit(EditorKit kit) Sets the currently installed kit for handling content. |
void | setEditorKitForContentType(String type, EditorKit k) Directly sets the editor kit to use for the given type. |
void | setEnabled(boolean enabled) Sets whether or not this component is enabled. |
void | setFocusable(boolean focusable) Sets the focusable state of this Component to the specified value. |
void | setFont(Font font) Sets the font for this component. |
void | setForeground(Color fg) Sets the foreground color of this component. |
void | setInputMap(int condition, InputMap map) Sets the InputMap to use under the condition condition to map . |
void | setMaximumSize(Dimension maximumSize) Sets the maximum size of this component to a constant value. |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
void | setOpaque(boolean isOpaque) If true the component paints every pixel within its bounds. |
void | setPage(URL page) Sets the current URL being displayed. |
void | setPage(String url) Sets the current URL being displayed. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component. |
void | setSize(int width, int height) Resizes this component so that it has width width and height height . |
void | setSize(Dimension d) Resizes this component so that it has width d.width and height d.height . |
void | setText(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. |
void | setToolTipText(String text) Registers the text to display in a tool tip. |
void | setTransferHandler(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. |
void | validate() Validates this container and all of its subcomponents. |