com.gluonhq.charm.glisten.control.TextField不存在 [英] com.gluonhq.charm.glisten.control.TextField does not exist

查看:256
本文介绍了com.gluonhq.charm.glisten.control.TextField不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用场景生成器来创建使用com.gluonhq.charm.glisten.control.TextField的用户界面.它可以在Scene Builder及其预览中正常工作.

I'm using scene builder to create an user interface which uses com.gluonhq.charm.glisten.control.TextField. It works properly in the Scene Builder and it's preview.

但是在NetBeans编辑器中,我得到类不存在错误.

But in the NetBeans editor I get the class does not exist error.

当我尝试运行应用程序时,出现以下运行时错误.

When I try to run the application, I get the following runtime error.

Caused by: java.lang.ClassNotFoundException: com.gluonhq.charm.glisten.control.TextField
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2916)
    at javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2905)
    at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2846)
    ... 60 more

我在Scene Builder中使用了库管理器来安装com.gluonhq:charm存储库.但是我仍然遇到那些错误.任何建议将不胜感激.

I used the Library manager in Scene Builder to install com.gluonhq:charm repository. But I still get those errors. Any suggestion will be highly appreciated.

推荐答案

,您可以从以下位置下载存储库: http://nexus.gluonhq .com/nexus/content/repositories/releases/com/gluonhq/charm-glisten/4.4.1/

you can download the repo from: http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten/4.4.1/

如果将此添加为JavaFX应用程序中的库,并在FXMLDocumentController中通过导入引用它:

If you add this as a library in your JavaFX application and reference it with an import in the FXMLDocumentController:

import com.gluonhq.charm.glisten.control.ProgressBar; 
import com.gluonhq.charm.glisten.control.ProgressIndicator;
import com.gluonhq.charm.glisten.control.TextField;   

当然还有FXML文件的链接:

And ofcourse the link to the FXML file:

@FXML
private ProgressIndicator progress;
@FXML
private ProgressBar progressbar;
@FXML
private TextField textfield;

在FXML文件中:

<?import com.gluonhq.charm.glisten.control.ProgressBar?>
<?import com.gluonhq.charm.glisten.control.ProgressIndicator?>
<?import com.gluonhq.charm.glisten.control.TextField?>

并且不要忘记设置fx:id:

and do not forget to set the fx:id:

<ProgressIndicator fx:id="progress" layoutX="85.0" layoutY="14.0" opacity="0.75" prefHeight="132.0" prefWidth="137.0" progress="0.25" radius="75.0" />
<ProgressBar fx:id="progressbar" layoutX="16.0" layoutY="177.0" opacity="0.75" prefHeight="18.0" prefWidth="288.0" progress="0.75" />
<TextField fx:id="textfield" layoutX="118.0" layoutY="80.0" prefHeight="27.0" prefWidth="92.0" />

它应该可以工作(对我来说很好= ^)

It should work (works fine with me =^)

有关更多信息,请参见:

see for more info:

http://docs.gluonhq.com/charm/javadoc/4.3.5/index.html?com/gluonhq/charm/glisten/control/TextField.html

这篇关于com.gluonhq.charm.glisten.control.TextField不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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