#navi(contents-page-name): No such page: ST

FrontPage

Terai Atsuhiro 2023-10-12 (木) 10:58:52

http://terai.s55.xrea.com/swing/texturepaint/screenshot.png

URL url = MainPanel.class.getResource("16x16.png");
BufferedImage bfimage = null;
try {
  bfimage = ImageIO.read(url);
}catch(IOException ioe) {
  ioe.printStackTrace();
}
Rectangle2D r2d = new Rectangle2D.Double(0,0,bfimage.getWidth(),bfimage.getHeight());
texture = new TexturePaint(bfimage, r2d);
public void paintComponent(Graphics g) {
  Graphics2D g2 = (Graphics2D)g;
  g2.setPaint(new TexturePaint(image, r2d));
  g2.fillRect(0, 0, getWidth(), getHeight());
  super.paintComponent(g);
}
  • ST/BackgroundImage