为什么我的 Java Applet 中的 Swing 在鼠标快速悬停时闪烁? [英] Why does Swing in my Java Applet flicker on fast mouse over?
问题描述
我制作了一个带有一些标准 GUI 组件的 Java Applet.我使用了 MigLayout 管理器.
I made a Java Applet with some Standard GUI Components on it. I used the MigLayout Manager.
如果我在各种 GUI 组件上缓慢移动鼠标,一切似乎都很好,但是如果我快速移动鼠标,它会闪烁.
If I move the mouse slowly over the various GUI Components everything appears to be fine, but if I move the mouse fast, it flickers.
是什么让那个讨厌的丑陋重绘?(Core 2 Duo 6300,2GB 内存,Windows XP)
What could make that nasty ugly redraw? (Core 2 Duo 6300, 2GB Ram, Windows XP)
推荐答案
一个想法是检查您的代码(和/或 MigLayout 代码)是否有不必要的 repaint()
操作.
One thought would be to check your code (and/or the MigLayout code) for unnecessary repaint()
operations.
自定义 UI 和布局有时会导致奇怪的问题...
Custom UIs and layouts can cause weird problems sometimes...
这篇关于为什么我的 Java Applet 中的 Swing 在鼠标快速悬停时闪烁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!