[英]Why can't I use JavaFX in JCreator?
I'm currently using JCreator 5.0 and JDK 1.7.0_51.我目前使用 JCreator 5.0 和 JDK 1.7.0_51。 I haven't had any issues when coding, and this time I decided to adventure myself in the realms of JavaFX, but it seems I can't reach any of its content.
我在编码时没有遇到任何问题,这次我决定在 JavaFX 领域冒险,但似乎我无法触及其中的任何内容。 Here's the error I get when I press the "Build File" button:
这是我按下“构建文件”按钮时得到的错误:
H:\Tareas\Projects\Test\Test1.java:1: error: package javafx.stage does not exist
import javafx.stage.*;
^
1 error
So, my questions are:所以,我的问题是:
I actually haven't coded anything yet, it just seems the import is not working.我实际上还没有编码任何东西,只是似乎导入不起作用。 This is the code so far, by the way, irrelevant I guess:
这是到目前为止的代码,顺便说一句,我猜是无关紧要的:
import javafx.stage.*;
public class Test1 {
public Test1() { }
}
Thanks in advance!!提前致谢!!
By the way, javafx.stage.* is not the only thing that gets me errors, in general, anything coming from javafx.* does the same :C, even "javafx.*" itself, I'm just using that as an example.顺便说一句,javafx.stage.* 并不是唯一让我出错的东西,一般来说,来自 javafx.* 的任何东西都是一样的:C,甚至“javafx.*”本身,我只是将它用作例子。 Cheers!
干杯!
edit:编辑:
I solved it now!我现在解决了! and I did it thanks to @MadProgrammer , after reading the thread he provided me !
感谢@MadProgrammer ,在阅读了他为我提供的线程后,我做到了! Thanks very much =) it was so simple!
非常感谢 =) 太简单了!
So what I found after reading the thread is that I needed to tell JCreator that such package existed, so I went through these steps in JCreator:所以我在阅读线程后发现我需要告诉 JCreator 这样的包存在,所以我在 JCreator 中完成了这些步骤:
Too long, didn't read : added "jfxrt.jar" to my JDK Profile in JCreator Options =)太长了,没看:在 JCreator Options 中将“jfxrt.jar”添加到我的 JDK Profile =)
Thanks very much!非常感谢!
I will be posting this as an answer soon, I just have to wait a couple hours due to having not enough reputation points, cheers everyone!我将很快将此作为答案发布,由于没有足够的声望点,我只需要等待几个小时,大家欢呼!
Too long, didn't read: add "jfxrt.jar" to your JDK Profile in JCreator Options =)太长了,没看:在 JCreator Options 中将 "jfxrt.jar" 添加到您的 JDK Profile =)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.