问题
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