ネストされたレイアウトの複雑なセットを持つ Swing アプリがあります。(複数の分割ペインとスクロールペイン) SplitPane 内の ScrollPane 内の Jpanel の 1 つには、さまざまなコントロールを含む Jpanel のリストが含まれています。
ときどきウィンドウのサイズを変更したり、新しいパネルのセットを再設定したりすると、そのパネルはちらつき狂乱状態になります。両方のスクロールバーが表示され、必要とされます。パネル内のコントロールのサイズがわずかに大きくなったり小さくなったりすると、パネルがちらつきます。
私はこれをデバッガーでキャッチしました-そして、私のコードはどれも呼び出されていません。すべて Swing/AWT コード内にあります。この間、私の Swing.invokeLater 呼び出しはどれも呼び出されていません。カスタム コントロールや描画は行われていません。これは、AWT EventQueue スレッドを一時停止したときにデバッガーが表示するスタック トレースです。
Thread [AWT-EventQueue-0] (Suspended)
X11TextRenderer.doDrawGlyphList(long, long, Region, GlyphList) line: not available [native method]
X11TextRenderer.drawGlyphList(SunGraphics2D, GlyphList) line: 62
X11TextRenderer(GlyphListPipe).drawChars(SunGraphics2D, char[], int, int, int, int) line: 86
SunGraphics2D.drawChars(char[], int, int, int, int) line: 2843
SwingUtilities2.drawChars(JComponent, Graphics, char[], int, int, int, int) line: 780
Utilities.drawTabbedText(View, Segment, int, int, Graphics, TabExpander, int, int[]) line: 170
Utilities.drawTabbedText(View, Segment, int, int, Graphics, TabExpander, int) line: 89
PlainView.drawUnselectedText(Graphics, int, int, int, int) line: 137
PlainView.drawElement(int, Element, Graphics, int, int) line: 96
PlainView.drawLine(int, Graphics, int, int) line: 65
PlainView.paint(Graphics, Shape) line: 288
BasicTextUI$RootView.paint(Graphics, Shape) line: 1422
BasicTextAreaUI(BasicTextUI).paintSafely(Graphics) line: 722
BasicTextAreaUI(BasicTextUI).paint(Graphics, JComponent) line: 869
BasicTextAreaUI(BasicTextUI).update(Graphics, JComponent) line: 848
JTextArea(JComponent).paintComponent(Graphics) line: 752
JTextArea(JComponent).paint(Graphics) line: 1029
JPanel(JComponent).paintChildren(Graphics) line: 862
JPanel(JComponent).paint(Graphics) line: 1038
JPanel(JComponent).paintChildren(Graphics) line: 862
JPanel(JComponent).paint(Graphics) line: 1038
JPanel(JComponent).paintChildren(Graphics) line: 862
JPanel(JComponent).paint(Graphics) line: 1038
JViewport(JComponent).paintChildren(Graphics) line: 862
JViewport(JComponent).paint(Graphics) line: 1038
JViewport.paint(Graphics) line: 747
JScrollPane(JComponent).paintChildren(Graphics) line: 862
JScrollPane(JComponent).paint(Graphics) line: 1038
JPanel(JComponent).paintChildren(Graphics) line: 862
JPanel(JComponent).paint(Graphics) line: 1038
JViewport(JComponent).paintChildren(Graphics) line: 862
JViewport(JComponent).paint(Graphics) line: 1038
JViewport.paint(Graphics) line: 747
JScrollPane(JComponent).paintChildren(Graphics) line: 862
JScrollPane(JComponent).paint(Graphics) line: 1038
JScrollPane(JComponent).paintToOffscreen(Graphics, int, int, int, int, int, int) line: 5124
BufferStrategyPaintManager.paint(JComponent, JComponent, Graphics, int, int, int, int) line: 278
RepaintManager.paint(JComponent, JComponent, Graphics, int, int, int, int) line: 1224
JScrollPane(JComponent)._paintImmediately(int, int, int, int) line: 5072
JScrollPane(JComponent).paintImmediately(int, int, int, int) line: 4882
RepaintManager.paintDirtyRegions(Map<Component,Rectangle>) line: 785
RepaintManager.paintDirtyRegions() line: 713
RepaintManager.seqPaintDirtyRegions() line: 693
SystemEventQueueUtilities$ComponentWorkRequest.run() line: 125
InvocationEvent.dispatch() line: 209
EventQueue.dispatchEventImpl(AWTEvent, Object) line: 641
EventQueue.access$000(EventQueue, AWTEvent, Object) line: 84
EventQueue$1.run() line: 602
EventQueue$1.run() line: 600
AccessController.doPrivileged(PrivilegedAction<T>, AccessControlContext) line: not available [native method]
AccessControlContext$1.doIntersectionPrivilege(PrivilegedAction<T>, AccessControlContext, AccessControlContext) line: 87
EventQueue.dispatchEvent(AWTEvent) line: 611
EventDispatchThread.pumpOneEventForFilters(int) line: 269
EventDispatchThread.pumpEventsForFilter(int, Conditional, EventFilter) line: 184
EventDispatchThread.pumpEventsForHierarchy(int, Conditional, Component) line: 174
EventDispatchThread.pumpEvents(int, Conditional) line: 169
EventDispatchThread.pumpEvents(Conditional) line: 161
EventDispatchThread.run() line: 122