本文整理了Java中javax.swing.JTextPane.getParent()
方法的一些代码示例,展示了JTextPane.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.getParent()
方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:getParent
暂无
代码示例来源:origin: vsch/flexmark-java
public static void setRegExError(String error, JTextPane jTextPane, final Font textFont, final BackgroundColor validTextFieldBackground, final BackgroundColor warningTextFieldBackground) {
HtmlBuilder html = new HtmlBuilder();
html.tag("html").style("margin:2px;vertical-align:middle;").attr(validTextFieldBackground, textFont).tag("body");
html.attr(warningTextFieldBackground).tag("div");
html.append(toHtmlError(error, true));
html.closeTag("div");
html.closeTag("body");
html.closeTag("html");
jTextPane.setVisible(true);
jTextPane.setText(html.toFinalizedString());
jTextPane.revalidate();
jTextPane.getParent().revalidate();
jTextPane.getParent().getParent().revalidate();
}
代码示例来源:origin: ron190/jsql-injection
boolean isCaretAtEnd = this.getProxy().getCaretPosition() == this.getProxy().getDocument().getLength();
JScrollPane v = (JScrollPane) this.getProxy().getParent().getParent();
JScrollBar vertical = v.getVerticalScrollBar();
int extent = vertical.getModel().getExtent();
代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing
public void run()
{
final Point pos = ((JViewport)details.getParent())
.getViewPosition();
// System.out.println("Pos: " + pos);
details.setText(report);
details.repaint();
// details.setCaretPosition(0);
((JViewport)details.getParent()).setViewPosition(pos);
// Hack!!! Reset position after freeing the event thread,
// something seems to destroy the position, grrr.
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
((JViewport)details.getParent()).setViewPosition(pos);
}
});
// JScrollPane scroll = (JScrollPane)details.getParent().getParent();
// int h = scroll.getHorizontalScrollBar().getValue();
// int v = scroll.getVerticalScrollBar().getValue();
// System.out.println("Pos: h="+h+", v="+v);
// details.setText(text.toString());
// details.setCaretPosition(0);
// scroll.getHorizontalScrollBar().setValue(h);
// scroll.getVerticalScrollBar().setValue(v);
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-runtimetools-swing
public void run()
{
final Point pos = ((JViewport)details.getParent())
.getViewPosition();
// System.out.println("Pos: " + pos);
details.setText(report);
details.repaint();
// details.setCaretPosition(0);
((JViewport)details.getParent()).setViewPosition(pos);
// Hack!!! Reset position after freeing the event thread,
// something seems to destroy the position, grrr.
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
((JViewport)details.getParent()).setViewPosition(pos);
}
});
// JScrollPane scroll = (JScrollPane)details.getParent().getParent();
// int h = scroll.getHorizontalScrollBar().getValue();
// int v = scroll.getVerticalScrollBar().getValue();
// System.out.println("Pos: h="+h+", v="+v);
// details.setText(text.toString());
// details.setCaretPosition(0);
// scroll.getHorizontalScrollBar().setValue(h);
// scroll.getVerticalScrollBar().setValue(v);
}
});
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
parent = m_Output.getParent();
outputOld = m_Output;
if (m_UseWordwrap) {
代码示例来源:origin: Waikato/weka-trunk
parent = m_Output.getParent();
outputOld = m_Output;
if (m_UseWordwrap) {
代码示例来源:origin: com.vladsch.flexmark/flexmark-util
public static void setRegExError(String error, JTextPane jTextPane, final Font textFont, final BackgroundColor validTextFieldBackground, final BackgroundColor warningTextFieldBackground) {
HtmlBuilder html = new HtmlBuilder();
html.tag("html").style("margin:2px;vertical-align:middle;").attr(validTextFieldBackground, textFont).tag("body");
html.attr(warningTextFieldBackground).tag("div");
html.append(toHtmlError(error, true));
html.closeTag("div");
html.closeTag("body");
html.closeTag("html");
jTextPane.setVisible(true);
jTextPane.setText(html.toFinalizedString());
jTextPane.revalidate();
jTextPane.getParent().revalidate();
jTextPane.getParent().getParent().revalidate();
}
代码示例来源:origin: chatty/chatty
r.translate(sourceWidth / 2 - labelSize.width / 2, 0);
r.translate(textPane.getLocationOnScreen().x, textPane.getLocationOnScreen().y);
Component viewPort = textPane.getParent();
if (viewPort instanceof JViewport) {
代码示例来源:origin: intellij-dlanguage/intellij-dlanguage
final Container tabContent = textArgsPane.getParent();
final GridLayoutManager layout = (GridLayoutManager) tabContent.getLayout();
final GridConstraints constraints = layout.getConstraintsForComponent(textArgsPane);
内容来源于网络,如有侵权,请联系作者删除!