javax.swing.JTextPane.read()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中javax.swing.JTextPane.read()方法的一些代码示例,展示了JTextPane.read()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.read()方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:read

JTextPane.read介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JTextPane pane;
..
HTMLDocument htmlDocument = (HTMLDocument) pane.getDocument();
htmlDocument.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
htmlDocument.putProperty(Document.StreamDescriptionProperty, pageUrl);
pane.read(connection.getInputStream, htmlDocument);

代码示例来源:origin: stackoverflow.com

EditorKit editorKit = new StyledEditorKit()
{
  public Document createDefaultDocument()
  {
    return new ColoredDocument();
  }
};

JTextPane textPane = new JTextPane();
textPane.setEditorKit( editorKit );

FileReader fr = new FileReader( ... );
BufferedReader br = new BufferedReader( fr );
textPane.read( br, null );

代码示例来源:origin: robo-code/robocode

@Override
public void read(Reader in, Object desc) throws IOException {
  JavaDocument javaDocument = (JavaDocument) getDocument();
  // Bug-357: Tab characters are inserted in the last line of a robot source file when opening it.
  // This bug was fixed by disabling auto-indentation while reading the file.
  javaDocument.setReplacingText(true);
  super.read(in, desc);
  javaDocument.setReplacingText(false);
  resetCaretPosition();
  undoManager.discardAllEdits();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mobility-cldcplatform

infoPanel.putClientProperty("charset", charset); // NOI18N
  infoPanel.read( descURL.openStream(), descURL );
} catch (ChangedCharSetException x) {
  Document doc = infoPanel.getEditorKit().createDefaultDocument();
  doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); // NOI18N
  try {
    infoPanel.read(descURL.openStream(), doc);
  } catch (IOException ioe) {
    ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ioe);

相关文章

JTextPane类方法