本文整理了Java中javax.swing.JTextPane.paint()
方法的一些代码示例,展示了JTextPane.paint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.paint()
方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:paint
暂无
代码示例来源:origin: ron190/jsql-injection
@Override
public void paint(Graphics g) {
// Fix #4012: ArrayIndexOutOfBoundsException on paint()
// Fix #38546: ConcurrentModificationException on getText()
// Fix #37872: IndexOutOfBoundsException on getText()
// Fix #48915: ClassCastException on paint()
try {
super.paint(g);
if ("".equals(Jsoup.parse(this.getText()).text().trim())) {
this.drawPlaceholder(this, g, this.placeholderText);
}
} catch (ConcurrentModificationException | IndexOutOfBoundsException | ClassCastException e) {
LOGGER.error(e.getMessage(), e);
}
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
public void paint(Graphics _g)
{
BuLib.setAntialiasing(this,_g);
super.paint(_g);
}
代码示例来源:origin: net.sf.ingenias/ingeniasjgraphmod
/**
* Utility method to paint the rich text content for rich text values. This
* implementation simulates rich text vertical alignment by translating the
* graphics before painting the textPane.
*
* @param g
* The graphics to paint the rich text content to.
*/
protected void paintRichText(Graphics g) {
textPane.setSize(getSize());
int yoffset = 0;
// Computes the vertical offset to match the vertical alignment
if (getVerticalAlignment() == CENTER)
yoffset = (int) ((getHeight() - textPane.getPreferredSize()
.getHeight()) / 2)
+ 2 * INSET;
else if (getVerticalAlignment() == BOTTOM)
yoffset = (int) (getHeight()
- textPane.getPreferredSize().getHeight() + 3 * INSET);
g.translate(0, yoffset);
textPane.paint(g);
g.translate(0, -yoffset);
}
内容来源于网络,如有侵权,请联系作者删除!