Eines meiner Swing-Programme wirft gelegentlich beim Start eine (die Funktion nicht weiter störende) Ausnahme, die ich natürlich gern beseitigen würde. Alle dort auftauchenden Klassen gehören zu Java selbst und die Fehlermeldung taucht nur sporadisch auf, weswegen ich nicht systematisch Teile abklemmen und nach ihr suchen kann. Beim Debuggen tritt sie bislang leider gar nicht auf. Vielleicht ist es ein Timing-Problem.
Falls hier jemand eine gute Idee hat, wonach ich vielleicht schauen oder was ich probieren könnte, wäre ich froh.
Die Fehlermeldung lautet:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException
at java.desktop/javax.swing.LayoutComparator.compare(LayoutComparator.java:76)
at java.desktop/javax.swing.LayoutComparator.compare(LayoutComparator.java:42)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.mergeSort(SortingFocusTraversalPolicy.java:652)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.mergeSort(SortingFocusTraversalPolicy.java:666)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.mergeSort(SortingFocusTraversalPolicy.java:667)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.mergeSort(SortingFocusTraversalPolicy.java:666)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.mergeSort(SortingFocusTraversalPolicy.java:666)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.mergeSort(SortingFocusTraversalPolicy.java:666)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.legacySort(SortingFocusTraversalPolicy.java:163)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:152)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(SortingFocusTraversalPolicy.java:125)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocusTraversalPolicy.java:478)
at java.desktop/javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusTraversalPolicy.java:167)
at java.desktop/javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFocusTraversalPolicy.java:571)
at java.desktop/java.awt.FocusTraversalPolicy.getInitialComponent(FocusTraversalPolicy.java:169)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:481)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4871)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2769)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4822)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.SequencedEvent.dispatch(SequencedEvent.java:204)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)