62,614
社区成员
发帖
与我相关
我的任务
分享
body
{
background-image: url(stars.gif);
background-repeat: repeat-x;
}
Graphics2D g2d = (Graphics2D) g;
g2d.setPaint(new TexturePaint(buffImage, new Rectangle2D.Float(
0, 0, buffImage.getWidth(), buffImage.getHeight())));
g2d.fillRect(0, 0, this.getWidth(), buffImage.getHeight());
JPanel panel = new JPanel() {
public void paintComponent(Graphics g) {
Image imgBg = new ImageIcon("./Resource/bg.gif").getImage();
for (int i = 0, x = 0, y = 0; i <= Mainframe.WIDTH / imgBg.getWidth(null) + 1; i++) {
g.drawImage(imgBg, x, y, imgBg.getWidth(null), getHeight(), null);
x += imgBg.getWidth(null);
}
}
};