是什么导致AWTEventMulticaster.mouseEntered()中的无限递归? [英] What causes an endless recursion in AWTEventMulticaster.mouseEntered()?

查看:85
本文介绍了是什么导致AWTEventMulticaster.mouseEntered()中的无限递归?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在已经做了JFrame了一点,自从我开始使用Mouselistener(或任何事件列表器)以来,事情运行了大约2分钟左右.然后,我会得到很多重复的错误,程序仍然可以运行,但是我可以使用任何事件监听器.错误基本上是这样的: ...

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: ...

(无法及时捕获顶行,但类似于线程"AWT-EventQueue-0" java.lang.StackOverflowError中的异常) (随后)

(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)
...

重复数百行,其中mouseEntered可以是任何事件列表.

repeating for hundreds of hundred of lines, where mouseEntered could be any of the eventlistners.

我已经花了很多时间检查所有整数,看它们是否过高(找到一个整数,修复它,仍然会发生).我还在所有地方检查了一个调用其自身的值,但这没有多大意义,因为它发生的时间大约是2分钟.

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.

推荐答案

我猜想,最可能的原因是您已经将组件直接或间接地放入了自身.

I guess the most likely reason for this is that you have put a component into itself (either directly or indirectly).

这篇关于是什么导致AWTEventMulticaster.mouseEntered()中的无限递归?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆