【问题标题】:Libgdx game making tutorial (Drop) Iterator<Rectangle>Libgdx 游戏制作教程 (Drop) Iterator<Rectangle>
【发布时间】:2014-08-27 13:05:38
【问题描述】:

所以我对 libgdx 非常陌生,我正在做 libgdx wiki 上的 drop 教程。所以当我完成时,我在 Iterator&lt;Rectangle&gt; iter = raindrops.iterator(); 的第 98 行遇到错误 更具体地说,它说:

HTMLDocument.iterator 类型不是遗传的;它不可能是 参数化参数&lt;Rectangle&gt;

我也在控制台中得到这个:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.Error: Unresolved compilation problem: 
The type HTMLDocument.Iterator is not generic; it cannot be parameterized with arguments <Rectangle>
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: java.lang.Error: Unresolved compilation problem: 
The type HTMLDocument.Iterator is not generic; it cannot be parameterized with arguments <Rectangle>
at com.mygdx.test.Test.render(Test.java:98)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:206)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

如果您知道解决方案,我真的不知道为什么会出现此错误,我将非常感谢您的帮助。感谢您的宝贵时间。

【问题讨论】:

    标签: java libgdx


    【解决方案1】:

    好像你不小心添加了错误的导入!

    你需要导入:

     import java.util.Iterator;
    

    代替:

     import javax.swing.text.html.HTMLDocument.Iterator;
    

    因为HTMLDocument.Iterator根本不使用libgdx drop tutorial

    【讨论】:

    • 是的!!!它似乎终于起作用了!!非常感谢我一个月以来一直在寻找修复程序,现在你无法相信我是多么感激!!
    【解决方案2】:

    我相信这是因为 html 项目没有自动正确设置。也许试试this

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-25
      • 2016-05-16
      • 2014-04-12
      • 2011-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多