📄 jtextpane.html
字号:
<!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getUIClassID()"><!-- --></A><H3>getUIClassID</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getUIClassID</B>()</PRE><DL><DD>Returns the class ID for the UI.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../javax/swing/JEditorPane.html#getUIClassID()">getUIClassID</A></CODE> in class <CODE><A HREF="../../javax/swing/JEditorPane.html">JEditorPane</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the ID ("TextPaneUI")<DT><B>See Also: </B><DD><A HREF="../../javax/swing/JComponent.html#getUIClassID()"><CODE>JComponent.getUIClassID()</CODE></A>, <A HREF="../../javax/swing/UIDefaults.html#getUI(javax.swing.JComponent)"><CODE>UIDefaults.getUI(javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="setDocument(javax.swing.text.Document)"><!-- --></A><H3>setDocument</H3><PRE>public void <B>setDocument</B>(<A HREF="../../javax/swing/text/Document.html">Document</A> doc)</PRE><DL><DD>Associates the editor with a text document. This must be a StyledDocument.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../javax/swing/text/JTextComponent.html#setDocument(javax.swing.text.Document)">setDocument</A></CODE> in class <CODE><A HREF="../../javax/swing/text/JTextComponent.html">JTextComponent</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>doc</CODE> - the document to display/edit<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if doc can't be narrowed to a StyledDocument which is the required type of model for this text component</DL></DD></DL><HR><A NAME="setStyledDocument(javax.swing.text.StyledDocument)"><!-- --></A><H3>setStyledDocument</H3><PRE>public void <B>setStyledDocument</B>(<A HREF="../../javax/swing/text/StyledDocument.html">StyledDocument</A> doc)</PRE><DL><DD>Associates the editor with a text document. The currently registered factory is used to build a view for the document, which gets displayed by the editor.<DD><DL><DT><B>Parameters:</B><DD><CODE>doc</CODE> - the document to display/edit</DL></DD></DL><HR><A NAME="getStyledDocument()"><!-- --></A><H3>getStyledDocument</H3><PRE>public <A HREF="../../javax/swing/text/StyledDocument.html">StyledDocument</A> <B>getStyledDocument</B>()</PRE><DL><DD>Fetches the model associated with the editor.<DD><DL><DT><B>Returns:</B><DD>the model</DL></DD></DL><HR><A NAME="replaceSelection(java.lang.String)"><!-- --></A><H3>replaceSelection</H3><PRE>public void <B>replaceSelection</B>(<A HREF="../../java/lang/String.html">String</A> content)</PRE><DL><DD>Replaces the currently selected content with new content represented by the given string. If there is no selection this amounts to an insert of the given text. If there is no replacement text this amounts to a removal of the current selection. The replacement text will have the attributes currently defined for input. If the document is not editable, beep and return. Then if the document is null, do nothing. If the content to insert is null or empty, ignore it. <p> This method is thread safe, although most Swing methods are not. Please see <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../javax/swing/JEditorPane.html#replaceSelection(java.lang.String)">replaceSelection</A></CODE> in class <CODE><A HREF="../../javax/swing/JEditorPane.html">JEditorPane</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>content</CODE> - the content to replace the selection with</DL></DD></DL><HR><A NAME="insertComponent(java.awt.Component)"><!-- --></A><H3>insertComponent</H3><PRE>public void <B>insertComponent</B>(<A HREF="../../java/awt/Component.html">Component</A> c)</PRE><DL><DD>Inserts a component into the document as a replacement for the currently selected content. If there is no selection the component is effectively inserted at the current position of the caret. This is represented in the associated document as an attribute of one character of content.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the component to insert</DL></DD></DL><HR><A NAME="insertIcon(javax.swing.Icon)"><!-- --></A><H3>insertIcon</H3><PRE>public void <B>insertIcon</B>(<A HREF="../../javax/swing/Icon.html">Icon</A> g)</PRE><DL><DD>Inserts an icon into the document as a replacement for the currently selected content. If there is no selection the icon is effectively inserted at the current position of the caret. This is represented in the associated document as an attribute of one character of content. <p> This method is thread safe, although most Swing metho
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -