All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JEditorPane

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.text.JTextComponent
                                   |
                                   +----com.sun.java.swing.JTextPane
                                           |
                                           +----com.sun.java.swing.JEditorPane

public class JEditorPane
extends JTextPane
A text pane to edit various kinds of content, such as html and rtf. This uses implementations of the EditorKit to accomplish it's behavior.


Constructor Index

 o JEditorPane()
 o JEditorPane(String)
Creates a JEditorPane based on a string containing a URL specification.
 o JEditorPane(URL)
Creates a JEditorPane based on a specified URL for input.

Method Index

 o getPage()
Gets the current url being displayed.
 o getUIClassID()
 o linkActivated(URL)
Follows the reference in an link.
 o setPage(String)
Sets the current url being displayed.
 o setPage(URL)
Sets the current url being displayed.

Constructors

 o JEditorPane
 public JEditorPane()
 o JEditorPane
 public JEditorPane(URL initialPage) throws IOException
Creates a JEditorPane based on a specified URL for input.

Parameters:
initialPage - the URL
Throws: IOException
if the URL cannot be accessed
 o JEditorPane
 public JEditorPane(String url) throws IOException
Creates a JEditorPane based on a string containing a URL specification.

Parameters:
url - the URL
Throws: IOException
if the URL cannot be accessed

Methods

 o setPage
 public void setPage(URL page) throws IOException
Sets the current url being displayed.

Parameters:
page - the URL of the page
Throws: IOException
for an invalid page specification
 o getPage
 public URL getPage()
Gets the current url being displayed. If a URL was not specified in the creation of the document, this will return null, and relative URL's will not be resolved.

Returns:
the URL
 o setPage
 public void setPage(String url) throws IOException
Sets the current url being displayed.

Parameters:
url - the URL for display
Throws: IOException
for an invalid URL specification
 o linkActivated
 protected void linkActivated(URL u)
Follows the reference in an link. The given url is the requested reference. By default this calls setPage, and if an exception is thrown the original previous document is restored and a beep sounded. If an attempt was made to follow a link, but it represented a malformed url, this method will be called with a null argument.

Parameters:
u - the URL to follow
 o getUIClassID
 public String getUIClassID()
Overrides:
getUIClassID in class JTextPane

All Packages  Class Hierarchy  This Package  Previous  Next  Index