1

I attempted to create a Gluon Mobile application whit the Glisten Afterburner framework on Intelij, however once i create it i cannot even launch it.

If i try to run the program i get the following error: enter image description here

If i try to use scene builder in any of the fxml files: enter image description here

My fxml code is the one generated by default:

<?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>

StackTrace: 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")));
    }
}
João Marques
  • 121
  • 1
  • 1
  • 14
  • IntelliJ doesn't open FXML files with custom controls (you need to open it with Gluon Scene Builder), so that's not related to the error running the application. Post the stacktrace. – José Pereda Feb 19 '18 at 17:57
  • How do i post the stacktrace? Kind of new to gluon? – João Marques Feb 19 '18 at 17:59
  • See the output of the gradle task `run`. Or run from a terminal: `./gradlew --info run`. – José Pereda Feb 19 '18 at 18:01
  • I updated the question, i hope it can be easier now to understand the problem. – João Marques Feb 19 '18 at 18:08
  • While it'd be better if you post the stacktrace with text instead of a screenshot, it's clear enough to find the issue: You are running Java 9, aren't you? The Glisten-Afterburner and the jfxmobile plugin 1.3.10 are for Java 8. There is a template (Single project with Gluon VM) with plugin 2.0.8 intended for Java 9. – José Pereda Feb 19 '18 at 18:12
  • Yes im running whit java 9, i will instal java 8 and see if it works. Thanks. – João Marques Feb 19 '18 at 18:14

0 Answers0