I've been doing JFrame for a little bit now, and ever since I started using Mouselistener (or any eventlistner for that matter) things would run smooth for about 2 mins or so. Then I would get a ton of repeating errors, the program would still run but I would be able to use any eventlistener. The error is basically this:
...
(couldn't catch top line in time, but something like Exception in 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)
...
repeating for hundreds of hundred of lines, where mouseEntered could be any of the eventlistners.
I've already spent alot of time going through at checking all integers to see if they go too high(found one, fixed it, still happens). I've also checked everywhere for a value that calls its self, but that doesn't make much sense because it happens like 2 mins into it.
I don't think is has to do with any specific code, just tell me what it means and how I could go about fixing it. It would help if you can post the code for the MouseListener and how it's being used.
以上就是What causes an endless recursion in AWTEventMulticaster.mouseEntered()?的详细内容,更多请关注web前端其它相关文章!