i dont know too. up!

解决方案 »

  1.   

    写一个class,含有两个icon不就行了。
      

  2.   

    楼上什么意思啊?我就是想知道怎么合成啊?那这个CLASS该怎么写啊?
      

  3.   

    继承icon啊,用两个icon来构造!
      

  4.   

    楼上在说清楚点啊,怎么用两个icon来构造>我没有找到方法.我现在就是想知道怎么把两个icon 合为一个,你说用两个icon来构造,还是不明白..
      

  5.   

    我觉得应该是把icon 变成 bufferedimage,然后再用它来合成吧.简单的把两个icon合在一起好象不行,得借助于其他的办法,希望能得到大家的帮助啊.
      

  6.   

    我想可以写一个继承icon的class,这个class有个Panel,可以在Panel上贴上两个icon。
      

  7.   

    这样不行啊,我得到panel有什么用呢?我最终想要的是一个icon啊..领导告诉我说可以用bufferedimage之类的将icon合成,可是我没有找到合适的办法.不过,还是非常感谢你呀(楼上). :)
      

  8.   

    class FinishedIcon
        implements Icon
    {
        private int x_pos;
        private int y_pos;
        private int width;
        private int height;
        private Icon fileIcon;
        private Image image;
        private Rectangle rect;
        public FinishedIcon(Icon fileIcon,Rectangle rect)
        {
            this.fileIcon = fileIcon;
            image = BaseFlowIcons.IMAGE_FINISH;
            width = fileIcon.getIconWidth();
            height = fileIcon.getIconHeight();
            rect=rect;
        }    public void paintIcon(Component c, Graphics g, int x, int y)
        {
            this.x_pos = x;
            this.y_pos = y;        int y_p = y + 2;        g.drawImage(image, width, height / 2, null);        if (fileIcon != null)
            {
                int w = (x - width) > 0 ? x - width : 0;
                fileIcon.paintIcon(c, g, width + 10, y_p / 2);
            }
        }    public int getIconWidth()
        {
            return width + (fileIcon != null ? fileIcon.getIconWidth() : 0);
        }    public int getIconHeight()
        {
            return height;
        }    public Rectangle getBounds()
        {
            return new Rectangle(rect.x , rect.y , width, height);
        }
    }如果有不明白的加我QQ.3505741