java - FXML scene builder invalid attribute after filling ComboBox -
java - FXML scene builder invalid attribute after filling ComboBox -
i have fxml file, tried populate combobox:
class="lang-xml prettyprint-override"><?xml version="1.0" encoding="utf-8"?> <?import java.lang.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <anchorpane maxheight="-infinity" maxwidth="-infinity" minheight="650.0" minwidth="750.0" prefheight="700.0" prefwidth="822.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="table.table"> <children> <menubutton fx:id="datefilter" layoutx="6.0" layouty="55.0" mnemonicparsing="false" prefheight="25.0" prefwidth="114.0" text="date" /> <combobox fx:id="descriptionfilter" editable="true" layoutx="226.0" layouty="55.0" prefheight="25.0" prefwidth="204.0" prompttext="series description"> <items> <fxcollections fx:factory="observablearraylist"> <string fx:value="1" /> <string fx:value="20" /> <string fx:value="300" /> </fxcollections> </items> </combobox> </children> </anchorpane>
but since populated it, won't open on scenebuilder , displays error:
error
java.io.ioexception: javafx.fxml.loadexception: invalid attribute. /c:/users/btap/workspace/tst/src/table/table.fxml:12
and won't load application:
caused by: javafx.fxml.loadexception: fxcollections not valid type.
note if remove fx:factory="observablearraylist"
loads on scene builder , show warning still won't run program.
and don't quite understand since it's same way saw in many examples example1, example2, example3.
why getting error? shouldn't work?
i know how fill elements code, looking fxml solution.
you need import fxcollections
class:
<?import javafx.collections.fxcollections ?>
java javafx javafx-2 fxml
Comments
Post a Comment