javax.swing.JEditorPane.getWidth()方法的使用及代码示例

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

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

JEditorPane.getWidth介绍

暂无

代码示例

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

//load the webpage into the editor
JEditorPane ed = new JEditorPane(new URL("http://www.google.com"));
ed.setSize(200,200);

//create a new image
BufferedImage image = new BufferedImage(ed.getWidth(), ed.getHeight(),
                    BufferedImage.TYPE_INT_ARGB);

//paint the editor onto the image
SwingUtilities.paintComponent(image.createGraphics(), 
               ed, 
               new JPanel(), 
               0, 0, image.getWidth(), image.getHeight());

//save the image to file
ImageIO.write((RenderedImage)image, "png", new File("google.png"));

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

JEditorPane jp = new JEditorPane("text/html", textString);
jp.validate();
int w = jp.getWidth(), h = jp.getHeight();
BufferedImage saveimg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = saveimg.createGraphics();
jp.paint(g2);

代码示例来源:origin: freeplane/freeplane

return;
final int lastWidth = textfield.getWidth();
final int lastHeight = textfield.getHeight();
final boolean lineWrap = lastWidth == maxWidth;

相关文章

JEditorPane类方法