重写了Jpanel的
protected void paintComponent(Graphics g) {
setOpaque(true);
super.paintComponent(g);
Dimension d = getSize();
for( int x = 0; x < d.width; x += image.getIconWidth() )
for( int y = 0; y < d.height; y += image.getIconHeight() )
g.drawImage( image.getImage(), x, y, null, null );
} 但显示的时候是不动的。不是刷新的...谢谢...
protected void paintComponent(Graphics g) {
setOpaque(true);
super.paintComponent(g);
Dimension d = getSize();
for( int x = 0; x < d.width; x += image.getIconWidth() )
for( int y = 0; y < d.height; y += image.getIconHeight() )
g.drawImage( image.getImage(), x, y, null, null );
} 但显示的时候是不动的。不是刷新的...谢谢...
我现在加一个线成.REPAIR()才能实现.
icon = .........;
JPanel panel = new JPanel();
JLabel imageLabel = new JLabel(icon);
panel.add(imageLabel);