Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.text.JTextComponent | +--com.sun.java.swing.JEditorPane | +--com.sun.java.swing.JTextPane
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JTextPane key assignments.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner classes inherited from class com.sun.java.swing.JEditorPane | |
JEditorPane.AccessibleJEditorPane |
Inner classes inherited from class com.sun.java.swing.text.JTextComponent | |
JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Fields inherited from class com.sun.java.swing.text.JTextComponent | |
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
Fields inherited from class com.sun.java.swing.JComponent | |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
JTextPane()
Constructs a new JTextPane. |
|
JTextPane(StyledDocument doc)
Constructs a new JTextPane, with a specified document model. |
Method Summary | |
Style | addStyle(java.lang.String nm,
Style parent)
Adds a new style into the logical style hierarchy. |
EditorKit | createDefaultEditorKit()
Creates the EditorKit to use by default. |
AttributeSet | getCharacterAttributes()
Fetches the character attributes in effect at the current location of the caret, or null. |
MutableAttributeSet | getInputAttributes()
Gets the input attributes for the pane. |
Style | getLogicalStyle()
Fetches the logical style assigned to the paragraph represented by the current position of the caret, or null. |
AttributeSet | getParagraphAttributes()
Fetches the current paragraph attributes in effect at the location of the caret, or null if none. |
boolean | getScrollableTracksViewportWidth()
Returns true if a viewport should always force the width of this Scrollable to match the width of the viewport. |
StyledDocument | getStyledDocument()
Fetches the model associated with the editor. |
StyledEditorKit | getStyledEditorKit()
Gets the editor kit. |
Style | getStyle(java.lang.String nm)
Fetches a named non-null style previously added. |
java.lang.String | getUIClassID()
Returns the class ID for the UI. |
void | insertComponent(java.awt.Component c)
Inserts a component into the document as a replacement for the currently selected content. |
void | insertIcon(Icon g)
Inserts an icon into the document as a replacement for the currently selected content. |
void | removeStyle(java.lang.String nm)
Removes a named non-null style previously added to the document. |
void | replaceSelection(java.lang.String content)
Replaces the currently selected content with new content represented by the given string. |
void | setCharacterAttributes(AttributeSet attr,
boolean replace)
Applies the given attributes to character content. |
void | setDocument(Document doc)
Associates the editor with a text document. |
void | setEditorKit(EditorKit kit)
Sets the currently installed kit for handling content. |
void | setLogicalStyle(Style s)
Sets the logical style to use for the paragraph at the current caret position. |
void | setParagraphAttributes(AttributeSet attr,
boolean replace)
Applies the given attributes to paragraphs. |
void | setStyledDocument(StyledDocument doc)
Associates the editor with a text document. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public JTextPane()
public JTextPane(StyledDocument doc)
doc
- the document modelMethod Detail |
public java.lang.String getUIClassID()
public void setDocument(Document doc)
doc
- the document to display/editpublic void setStyledDocument(StyledDocument doc)
doc
- the document to display/editpublic StyledDocument getStyledDocument()
public void replaceSelection(java.lang.String content)
This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.
content
- the content to replace the selection withpublic void insertComponent(java.awt.Component c)
c
- the component to insertpublic void insertIcon(Icon g)
This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.
g
- the icon to insertpublic Style addStyle(java.lang.String nm, Style parent)
nm
- the name of the style (must be unique within the
collection of named styles). The name may be null if the style
is unnamed, but the caller is responsible
for managing the reference returned as an unnamed style can't
be fetched by name. An unnamed style may be useful for things
like character attribute overrides such as found in a style
run.
parent
- the parent style. This may be null if unspecified
attributes need not be resolved in some other style.public void removeStyle(java.lang.String nm)
nm
- the name of the style to removepublic Style getStyle(java.lang.String nm)
nm
- the name of the stylepublic void setLogicalStyle(Style s)
This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.
s
- the logical style to assign to the paragraph, or null for
no stylepublic Style getLogicalStyle()
public AttributeSet getCharacterAttributes()
public void setCharacterAttributes(AttributeSet attr, boolean replace)
This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.
attr
- the attributes
replace
- if true, then replace the existing attributes firstpublic AttributeSet getParagraphAttributes()
public void setParagraphAttributes(AttributeSet attr, boolean replace)
This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.
attr
- the non-null attributes
replace
- if true, replace the existing attributes firstpublic MutableAttributeSet getInputAttributes()
protected final StyledEditorKit getStyledEditorKit()
protected EditorKit createDefaultEditorKit()
public final void setEditorKit(EditorKit kit)
kit
- the desired editor behavior.public boolean getScrollableTracksViewportWidth()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |