日期:2014-05-20  浏览次数:20709 次

在java开发中 怎样更换标题栏默认的coffe图标
本人是个菜鸟,正在做毕业设计项目,想把自已的项目搞得漂亮,但是对API又不太熟悉,请各位能给我支几招,怎么样做能达到意想不到的效果,或者说是特效,让人看了之后耳目一新的感觉,谢谢!

------解决方案--------------------
等下我给你写一个
------解决方案--------------------
学习 谢谢liujun999999(减肥中...)
------解决方案--------------------
我试个 好像不行啊 我们老师叫我用图片处理工具 做小就可以了
------解决方案--------------------
用以下代码修改图片的大小,我算是服务到家了:

private static String dir = " ";
private static String newDir = " ";

public static void zoomIconInDir(int width,int height){
File dirFile = new File(dir);
if(dirFile.exists() && dirFile.isDirectory()){
File [] children = dirFile.listFiles();
for(int i = 0; i <children.length; i++){
zoomIcon(children[i].getName(),width,height);
}
}
}
public static Icon zoomIcon(String iconPath,int width,int height){
File file = new File(dir+ "\\ "+iconPath);
BufferedImage bi = null;
try {
bi = ImageIO.read(file);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(bi==null)return null;

double wRatio = width/new Integer(bi.getWidth()).doubleValue();
double hRatio = height/new Integer(bi.getHeight()).doubleValue();
System.out.print(iconPath+ " : ");
System.out.println(wRatio+ " "+hRatio);

Image Itemp = bi.getScaledInstance (width,height,bi.SCALE_SMOOTH);
AffineTransformOp op = new AffineTransformOp(AffineTransform.getScaleInstance(wRatio, hRatio), null);
Itemp = op.filter(bi,null);

try{
ImageIO.write((BufferedImage)Itemp, "png " , new File(newDir+ "\\ "+iconPath));
}catch (Exception ex){
System.out.println( " ######## here error : " + ex);
}
return new ImageIcon(Itemp);
}
public static void main(String[] args){
dir = "******** ";
newDir = "************* ";
MethordSet.zoomIconInDir(24, 24);
}

//我想不用解释了吧,功能应该很明显才对。