关于图标问题.在线等!不甚感激! i dont know too. up! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 写一个class,含有两个icon不就行了。 楼上什么意思啊?我就是想知道怎么合成啊?那这个CLASS该怎么写啊? 继承icon啊,用两个icon来构造! 楼上在说清楚点啊,怎么用两个icon来构造>我没有找到方法.我现在就是想知道怎么把两个icon 合为一个,你说用两个icon来构造,还是不明白.. 我觉得应该是把icon 变成 bufferedimage,然后再用它来合成吧.简单的把两个icon合在一起好象不行,得借助于其他的办法,希望能得到大家的帮助啊. 我想可以写一个继承icon的class,这个class有个Panel,可以在Panel上贴上两个icon。 这样不行啊,我得到panel有什么用呢?我最终想要的是一个icon啊..领导告诉我说可以用bufferedimage之类的将icon合成,可是我没有找到合适的办法.不过,还是非常感谢你呀(楼上). :) 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 JTabbedPane 选项卡 紧急求教!!!! class中的构造器 哪位有JAVA编程思想第四版的书上源代码? hibernate问题 没分了 但是还是要来闻问一问;祝大家过个愉快的世界杯只月 如何判断字符串是不是合法的文件名? 各位大哥大姐,能否给一个JBuilder的开发界面的例子,谢谢了 谁帮我写个小程序--很小的 紧急求救!!!!!我先谢谢各位大哥了。 什么是PB? JAVA 实现缩放图片有什么好的算法? 怎么给jcheckbox前面默认小控件加上底色(如灰色)?
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