mac10.5的java采用的图形渲染方式变了

mac10.5 的渲染方式不再用以前默认的quartz了,现在默认为sun2d,所以如果老的代码里面有关repaint如果很多的话,会很影响效率,造成高cpu占用率,导致某些UI不能正常显示.

 

解决问题的办法如下:
java -Dapple.awt.graphics.UseQuartz="true" yourApplication

System.setProperty("apple.awt.graphics.UseQuartz", "true");

 

When using setting these properties within your application (using System.setProperty ), make sure that it's one of the first statements made inside of your main method. Doing so sets the property before AWT is loaded, ensuring that it takes effect.

因为applet在启动之前就已经装载了awt组件,所以applet程序现在无法在代码中实现转变使用老的quartz,只能在java preference那里加参数设置-Dapple.awt.graphics.UseQuartz=true了,这点有的麻烦,不知道apple或是sun公司能不能解决.

 

详情参考apple公司的文档
 http://developer.apple.com/documentation/Java/Conceptual/JavaPropVMInfoRef/Articles/JavaSystemProperties.html
 http://lists.apple.com/archives/Java-dev/2007/Dec/msg00108.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值