本文整理了Java中javax.swing.JEditorPane.revalidate()
方法的一些代码示例,展示了JEditorPane.revalidate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JEditorPane.revalidate()
方法的具体详情如下:
包路径:javax.swing.JEditorPane
类名称:JEditorPane
方法名:revalidate
暂无
代码示例来源:origin: stanfordnlp/CoreNLP
private void clearDocument() {
editorPane.setContentType("text/rtf");
Document doc = new DefaultStyledDocument();
editorPane.setDocument(doc);
// defaultAttrSet = ((StyledEditorKit)editorPane.getEditorKit()).getInputAttributes();
// StyleConstants.setFontFamily(defaultAttrSet, "Lucinda Sans Unicode");
log.info("attr: "+defaultAttrSet);
try {
doc.insertString(0, " ", defaultAttrSet);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
editorPane.setEditable(true);
editorPane.revalidate();
editorPane.repaint();
saveUntagged.setEnabled(false);
saveTaggedAs.setEnabled(false);
taggedContents = null;
htmlContents = null;
loadedFile = null;
}
代码示例来源:origin: stanfordnlp/CoreNLP
public void clearDocument() {
editorPane.setContentType("text/rtf");
Document doc = new DefaultStyledDocument();
editorPane.setDocument(doc);
// defaultAttrSet = ((StyledEditorKit)editorPane.getEditorKit()).getInputAttributes();
// StyleConstants.setFontFamily(defaultAttrSet, "Lucinda Sans Unicode");
log.info("attr: "+defaultAttrSet);
try {
doc.insertString(0, " ", defaultAttrSet);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
editorPane.setEditable(true);
editorPane.revalidate();
editorPane.repaint();
saveUntagged.setEnabled(false);
saveTaggedAs.setEnabled(false);
taggedContents = null;
untaggedContents = null;
htmlContents = null;
loadedFile = null;
}
代码示例来源:origin: stanfordnlp/CoreNLP
public void redraw() {
String text = editorPane.getText();
taggedContents = null;
untaggedContents = null;
if (!editorPane.getContentType().equals("text/html")) {
editorPane.setContentType("text/rtf");
Document doc = editorPane.getDocument();
try {
doc.insertString(0, text, defaultAttrSet);
} catch (Exception e) {
throw new RuntimeException(e);
}
editorPane.revalidate();
editorPane.repaint();
editorPane.setEditable(true);
htmlContents = null;
} else {
editorPane.setEditable(false);
htmlContents = editorPane.getText();
}
saveUntagged.setEnabled(false);
saveTaggedAs.setEnabled(false);
}
代码示例来源:origin: stanfordnlp/CoreNLP
private void removeTags() {
if (editorPane.getContentType().equals("text/html")) {
editorPane.setText(htmlContents);
editorPane.revalidate();
editorPane.repaint();
} else {
DefaultStyledDocument doc = (DefaultStyledDocument)editorPane.getDocument();
SimpleAttributeSet attr = new SimpleAttributeSet();
StyleConstants.setForeground(attr, Color.BLACK);
StyleConstants.setBackground(attr, Color.WHITE);
doc.setCharacterAttributes(0, doc.getLength(), attr, false);
}
saveTaggedAs.setEnabled(false);
}
代码示例来源:origin: stanfordnlp/CoreNLP
editorPane.revalidate();
editorPane.repaint();
} else {
editorPane.revalidate();
editorPane.repaint();
代码示例来源:origin: stanfordnlp/CoreNLP
private void removeTags() {
if (editorPane.getContentType().equals("text/html")) {
if (htmlContents != null) {
editorPane.setText(htmlContents);
}
editorPane.revalidate();
editorPane.repaint();
} else {
DefaultStyledDocument doc = (DefaultStyledDocument)editorPane.getDocument();
SimpleAttributeSet attr = new SimpleAttributeSet();
StyleConstants.setForeground(attr, Color.BLACK);
StyleConstants.setBackground(attr, Color.WHITE);
doc.setCharacterAttributes(0, doc.getLength(), attr, false);
}
saveTaggedAs.setEnabled(false);
}
代码示例来源:origin: stanfordnlp/CoreNLP
editorPane.revalidate();
editorPane.repaint();
} else {
editorPane.revalidate();
editorPane.repaint();
代码示例来源:origin: stanfordnlp/CoreNLP
throw new RuntimeException(e);
editorPane.revalidate();
editorPane.repaint();
editorPane.setEditable(true);
代码示例来源:origin: org.netbeans.api/org-openide-text
@Override
public void revalidate() {
if ((working & PAINT) != 0) {
super.revalidate();
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public void revalidate() {
if ((working & PAINT) != 0) {
super.revalidate();
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
public void revalidate() {
if ((working & PAINT) != 0) {
super.revalidate();
}
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components
private void showTextResponse(String response) {
results.setContentType("text/plain"); // $NON-NLS-1$
results.setText(response == null ? "" : response); // $NON-NLS-1$
results.setCaretPosition(0);
resultsScrollPane.setViewportView(results);
// Bug 55111 - Refresh JEditor pane size depending on the presence or absence of scrollbars
resultsScrollPane.setPreferredSize(resultsScrollPane.getMinimumSize());
results.revalidate();
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components
private void showHTMLFormattedResponse(String response) {
results.setContentType("text/plain"); // $NON-NLS-1$
results.setText(response == null ? "" : Jsoup.parse(response).html()); // $NON-NLS-1$
results.setCaretPosition(0);
resultsScrollPane.setViewportView(results);
// Bug 55111 - Refresh JEditor pane size depending on the presence or absence of scrollbars
resultsScrollPane.setPreferredSize(resultsScrollPane.getMinimumSize());
results.revalidate();
}
代码示例来源:origin: freeplane/freeplane
if(layoutMapOnTextChange)
parent.setPreferredSize(new Dimension(preferredSize.width + horizontalSpace , preferredSize.height + verticalSpace));
textfield.revalidate();
final NodeView nodeView = (NodeView) SwingUtilities.getAncestorOfClass(NodeView.class, parent);
final MapView mapView = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, nodeView);
内容来源于网络,如有侵权,请联系作者删除!