无法在Intelij上创建一个Gluon项目whit Glisten Afterburner

时间:2018-02-19 17:52:14

标签: javafx scenebuilder gluon gluon-mobile gluon-desktop

我尝试在Intelij上使用Glisten Afterburner框架创建一个Gluon Mobile应用程序,但是一旦我创建它,我甚至无法启动它。

如果我尝试运行该程序,我会收到以下错误: enter image description here

如果我尝试在任何fxml文件中使用场景构建器: enter image description here

我的fxml代码是默认生成的代码:

<?xml version="1.0" encoding="UTF-8"?>

<?import com.gluonhq.charm.glisten.control.Icon?>
<?import com.gluonhq.charm.glisten.mvc.View?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>


<View fx:id="primary" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="350.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.gluon.attempt.views.PrimaryPresenter">
   <center>
      <VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="15.0" BorderPane.alignment="CENTER">
         <children>
            <Label fx:id="label" text="%label.text.1" />
            <Button mnemonicParsing="false" onAction="#buttonClick" text="%button.text">
               <graphic>
                  <Icon content="LANGUAGE" />
               </graphic>
            </Button>
         </children>
      </VBox>
   </center>
</View>

堆栈跟踪: enter image description here

ApplicationCode:

package com.gluon.attempt;

import com.gluon.attempt.views.AppViewManager;
import com.gluonhq.charm.glisten.application.MobileApplication;
import com.gluonhq.charm.glisten.visual.Swatch;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class Attempt extends MobileApplication {

    @Override
    public void init() {
        AppViewManager.registerViewsAndDrawer(this);
    }

    @Override
    public void postInit(Scene scene) {
        Swatch.BLUE.assignTo(scene);


        ((Stage) scene.getWindow()).getIcons().add(new Image(Attempt.class.getResourceAsStream("/icon.png")));
    }
}

0 个答案:

没有答案