有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JavaFXControlsFX8.0.6对话框java。util。丢失资源异常

我是ControlsFX的新用户,我有一个我不明白的问题:

我的代码:

Dialogs.create()
    .owner(mainStage)
    .title("Information Dialog")
    .masthead("Test masthead")
    .message("Test message")
    .showInformation();

我得到一个例外:

Exception in thread "JavaFX Application Thread" java.util.MissingResourceException: Can't find bundle for base name impl.org.controlsfx.dialog.resources.oxygen.dialog-resources, locale fr_FR

有人知道为什么会这样吗

多谢各位


共 (1) 个答案

  1. # 1 楼答案

    你下载了正确的罐子吗?又名这个:ControlsFX-8.0.6

    因为我用我指定的JAR编写了这个最简单的程序,没有出现错误:

        import javafx.application.Application;
    import javafx.stage.Stage;
    import org.controlsfx.dialog.Dialogs;
    
    
    public class Test extends Application {
    
        @Override
        public void start(Stage primaryStage) {
            Dialogs.create()
                    .owner(primaryStage)
                    .title("Information Dialog")
                    .masthead("Test masthead")
                    .message("Test message")
                    .showInformation();
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            launch(args);
        }
    }
    
    请考虑在这里的官方组支持中提出问题:http://groups.controlsfx.org,你可能会有更多的答案。