JFrame在调整大小方面滞后 [英] JFrame is lagging on resize
问题描述
我有一个简单的JFrame,可以绘制背景颜色.但是,当我调整窗口大小时,背景颜色有些滞后,如屏幕截图所示.有办法防止这个问题吗?
Im having a simple JFrame which draws a background color. But when i resize the window, the background color is somehow lagging, as you can see in the screenshot. Is there a way to prevent this issue?
public class ToolBarTest extends JFrame{
public ToolBarTest(){
getContentPane().setBackground(new Color(221,221,221));
setSize(400,250);
setTitle("Hello");
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
public static void main(String ... args){
new ToolBarTest().setVisible(true);
}
}
解决方案:
删除JVM和JDK 7,然后重新安装Java6.
结论:不要在Mac OS上使用Java 7. (?)
SOLUTION:
Remove JVM and JDK 7 and reinstall java 6.
Conclusion: dont use java 7 on mac os. (?)
推荐答案
我尝试过Quaqua.同样,在Lion,Snow Leopard上无法正常工作,没问题... 那我只需要安装旧版本的JRE吗?
I tried Quaqua. Again, not working properly on Lion, Snow Leopard, no problem... So do i just need to install an older version of the JRE?
确实是JRE7.我更新了仍然使用Java 6的My Desktop Lion 10.7,但现在它也落后了.我的意思是,这很糟糕...
It is indeed the JRE 7. I updated My Desktop Lion 10.7, which was still using Java 6 – now its lagging too. I mean, this sucks big time...
这篇关于JFrame在调整大小方面滞后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!