可以把图片做成gif的动画来显示。

解决方案 »

  1.   

    to:skyyoung(路人甲)
    怎样改?能具体说说吗?谢谢!
      

  2.   

    安装java web start , 看看里面的Swing set demo.
    程序片段:
    ImageIcon icon[] = new ImageIcon[6];
    icon[0] = createImageIcon("tabbedpane/ewan.gif", getString("TabbedPaneDemo.ewan"));
        icon[1] = createImageIcon("tabbedpane/stephen.gif", getString("TabbedPaneDemo.stephen"));
        icon[2] = createImageIcon("tabbedpane/david.gif", getString("TabbedPaneDemo.david"));
        icon[3] = createImageIcon("tabbedpane/matthew.gif", getString("TabbedPaneDemo.matthew"));
        icon[4] = createImageIcon("tabbedpane/blake.gif", getString("TabbedPaneDemo.blake"));
        icon[5] = createImageIcon("tabbedpane/brooke.gif", getString("TabbedPaneDemo.brooke"));public void paint(Graphics g) {
        g.setColor(getBackground());
        g.fillRect(0, 0, getWidth(), getHeight());     for(int i = 0; i < numImages; i++) {
    if(x[i] > 3*i) {
        nudge(i);
        squish(g, icon[i], xh[i], yh[i], scale[i]);
    } else {
        x[i] += .05;
        y[i] += .05;
    }
        }
    }public void squish(Graphics g, ImageIcon icon, int x, int y, double scale) {
        if(isVisible()) {
    g.drawImage(icon.getImage(), x, y,
        (int) (icon.getIconWidth()*scale),
        (int) (icon.getIconHeight()*scale),
        this);
        } 
    }