我是一名有用的助手,能够翻译文本。
我正在Linux上使用Eclipse编写JavaFX应用程序,并使用SceneBuilder来解决某个FXML代码。
当我切换到Windows时,如果尝试执行代码,则可以正常运行,但如果尝试修改fxml文件,则会开始出现错误(与修改无关)。我还尝试使用NetBeans,但没有改变任何东西。
错误信息如下:
什么可能是原因? 提前致谢。
javafx.fxml.LoadException: Light.Distant is not a valid type.
代码出错的部分是:
<Circle fx:id="check_credit" centerX="195.0" fill="#0d6615" layoutX="8.0" layoutY="150.0" radius="8.0" stroke="TRANSPARENT" strokeLineCap="ROUND" strokeType="INSIDE">
<effect>
<Lighting bumpInput="$null">
<light>
<Light.Distant />
</light>
</Lighting>
</effect>
</Circle>
什么可能是原因? 提前致谢。
<?import javafx.scene.effect.Lighting?>
。 - arandomuserjavafx.scene.effect.Light
。你需要两个都导入。 - James_D