What causes infinite recursion in AWTEventMulticaster.mouseEntered ()?

I am doing a JFrame for a bit now, and since I started using the Mouselistener (or any eventlistner, for that matter), everything will work for exactly 2 minutes or so. Then I will get a ton of repeated errors, the program will still work, but I can use any eventlistener. The error is basically this: ...

(failed to catch the top line in time, but something like Exception in the thread "AWT-EventQueue-0" java.lang.StackOverflowError) (followed by)

at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
    at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:282)
...

repeated for hundreds of hundreds of lines, where mouseEntered can be any of the event participants.

, , ( , , ). , "", , 2 .

, - , , .

+3
5

, , ( ).

+1

, , , , , . , SWA- , , , , , MouseListener GUI MouseListener.

, , .

0

, , , Hovercraft [^ s] +? s ().

. , Swing, JInternalFrames, ..

, , ( , ), .
, , - ( !), . , , , . , , ...

, (, , , ?). , - , .

0

... - , ... , , . . , - .

.

0

In my experience, adding a given control multiple times to the same parent, then calling doLayout () can call stackoverflow with AWTEventMulticaster, however this can only be an error in a specific version of java. (Jdk_1.6.18) And this re-adding operation might seem pointless, but was a side effect of reusing the components.

AWTEventMulticaster is used to distribute motion control / resizing and KeyEvent processing. Check related operations.

0
source

All Articles