JFrame is lagging on resize

我是研究僧i 提交于 2019-12-12 00:53:04

问题


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);
    }
}



SOLUTION:

Remove JVM and JDK 7 and reinstall java 6.
Conclusion: dont use java 7 on mac os. (?)


回答1:


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?

EDIT: 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...



来源:https://stackoverflow.com/questions/18471675/jframe-is-lagging-on-resize

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!