本文整理汇总了Java中java.awt.Container.paint方法的典型用法代码示例。如果您正苦于以下问题:Java Container.paint方法的具体用法?Java Container.paint怎么用?Java Container.paint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Container
的用法示例。
在下文中一共展示了Container.paint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveGameRecord
import java.awt.Container; //导入方法依赖的package包/类
public void saveGameRecord(JFrame frame, String competidores, PvpScore pvpScore) {
try {
frame.validate();
frame.repaint();
Container c = frame.getContentPane();
c.validate();
c.repaint();
BufferedImage im = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
c.paint(im.getGraphics());
pvpScore.setGameRecord(im);
} catch (Exception ex) {
Logger.getLogger(OthelloTournament.class
.getName()).log(Level.SEVERE, null, ex);
}
}
示例2: saveFinal
import java.awt.Container; //导入方法依赖的package包/类
public void saveFinal(JPanel panel, String jogoNro) {
try {
panel.validate();
panel.repaint();
panel.validate();
panel.repaint();
Container c = panel;
BufferedImage im = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
c.paint(im.getGraphics());
ImageIO.write(im, "PNG", new File(PATH + File.separator + "jogo" + jogoNro + ".png"));
} catch (IOException ex) {
Logger.getLogger(OthelloTournament.class.getName()).log(Level.SEVERE, null, ex);
}
}