Reputation: 59
i have create a "Gluon Mobile multiple Views with FXML" project. picture of structure and error is attached. i have these problems: 1- i build android but classes in android section dont build. 2- scene builder dont open fxml becouse of:
com.gluonhq.charm.glisten.mvc.View
<?xml version="1.0" encoding="UTF-8"?>
<?import com.gluonhq.charm.glisten.control.Icon?>
<?import com.gluonhq.charm.glisten.mvc.View?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.layout.*?>
<View fx:id="primary" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="350.0" stylesheets="@primary.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.gluonapplication1.views.PrimaryPresenter">
<center>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="15.0" BorderPane.alignment="CENTER">
<children>
<TextArea fx:id="txtArea" text="txt area text"/>
<Label fx:id="label" text="Hello JavaFX World!" />
<Button mnemonicParsing="false" onAction="#buttonClick" text="Change the World!">
<graphic>
<Icon content="LANGUAGE" />
</graphic>
</Button>
</children>
</VBox>
</center>
</View>
Upvotes: 0
Views: 412
Reputation: 45456
Regarding the first issue, Android classes failing on NetBeans, the problem is due to having two Gradle plugins colliding: Gradle Support and NBAndroid.
Gluon/JavaFXPorts make use of the Gradle plugin for NetBeans, so this is a must. NBAndroid plugin could be used for logging for instance, but giving that both don't play well together, the solution is just disabling NBAndroid.
Notice that NBAndroid plugin will be under NetBeans->Tools->Plugins, Installed: Android and Android Gradle Support. Deactivate or uninstall both.
Restart NetBeans and Android errors will be solved.
About the FXML issue: FXML with Gluon controls (View
), failing to load on Scene Builder.
There are two issues here:
Install the Charm.jar
As posted here, using the Jar manager allows searching for charm
and installing the custom components, once it is found on a repository. Currently, com.gluonhq:charm:4.0.1
will be resolved.
In case the control list is empty, try searching for charm-glisten
, and install com.gluonhq:charm-glisten:4.0.1
. This dependency should be resolved by the charm.pom
, but it seems it might fail.
The second issue, once charm controls are installed, is related to opening the fxml file from the IDE: Charm controls are not found by Scene Builder and the load fails.
This is a known issue, and it will be fixed in the next release, so for now there are two options:
Launch Scene Builder, and go to Open...
, or Open recent
and open the FXML.
Edit the SceneBuilder.cfg file (found under C:\Users\<user>\AppData\Local\SceneBuilder\app\SceneBuilder.cfg
) and add the path of the installed custom jars to the class path variable app.classpath=
.
Upvotes: 2