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.
-
JEditorPane()
-
-
JEditorPane(String)
- Creates a JEditorPane based on a string containing a URL specification.
-
JEditorPane(URL)
- Creates a JEditorPane based on a specified URL for input.
-
getPage()
- Gets the current url being displayed.
-
getUIClassID()
-
-
linkActivated(URL)
- Follows the reference in an
link.
-
setPage(String)
- Sets the current url being displayed.
-
setPage(URL)
- Sets the current url being displayed.
JEditorPane
public JEditorPane()
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
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
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
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
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
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
getUIClassID
public String getUIClassID()
- Overrides:
- getUIClassID in class JTextPane
All Packages Class Hierarchy This Package Previous Next Index