/**
* Create a new empty image panel
*/
public ImagePanel() {
super();
Color base = Color.gray;
BufferedImage image = new BufferedImage(50, 50,
BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) image.getGraphics();
g.setColor(base);
g.fillRect(0, 0, image.getWidth(), image.getHeight());
g.setColor(base.darker());
g.fillRect(image.getWidth() / 2, 0, image.getWidth() / 2, image
.getHeight() / 2);
g.fillRect(0, image.getHeight() / 2, image.getWidth() / 2, image
.getHeight() / 2);
background = new TexturePaint(image, new Rectangle(0, 0, image
.getWidth(), image.getHeight()));
setBackground(Color.black);
}
ImagePanel.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:trashjam2017
作者:
评论列表
文章目录