我搜索了我的問題,但沒有找到有效的解決方案。我目前正在嘗試使用 JavaFx 編寫應用程序,并且正在嘗試為 FXML 文件加載控制器,但即使 SceneBuilder 找到了它,Eclipse 也沒有。這是我的 FXML 文件(位于 main/resources/ :<?xml version="1.0" encoding="UTF-8"?><?import javafx.scene.control.Button?><?import javafx.scene.control.ButtonBar?><?import javafx.scene.control.ChoiceBox?><?import javafx.scene.control.Label?><?import javafx.scene.control.ListView?><?import javafx.scene.control.ScrollBar?><?import javafx.scene.control.TextField?><?import javafx.scene.layout.AnchorPane?><?import javafx.scene.text.Font?><AnchorPane fx:id="homeScreenAnchorPane" prefHeight="544.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="view.GlobalVueController"> <children> <ListView fx:id="listView" layoutY="116.0" prefHeight="431.0" prefWidth="685.0" /> <ScrollBar layoutX="686.0" layoutY="116.0" orientation="VERTICAL" prefHeight="431.0" prefWidth="14.0" /> <ButtonBar layoutX="14.0" layoutY="14.0" prefHeight="40.0" prefWidth="458.0"> <buttons> <TextField fx:id="searchBar" prefHeight="26.0" prefWidth="491.0" /> </buttons> </ButtonBar> <Button fx:id="addButtonHS" layoutX="502.0" layoutY="14.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="75.0" text="Add" /> <Button fx:id="supprButtonHS" layoutX="611.0" layoutY="14.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="75.0" text="Suppr" /> <Label layoutX="14.0" layoutY="74.0" text="Flitrer par groupe :"> <font> <Font size="18.0" /> </font> </Label> <ChoiceBox fx:id="groupFilter" layoutX="192.0" layoutY="75.0" prefWidth="150.0" /> </children></AnchorPane>這是我的主要應用程序(我在其中加載 FXML):public class ContactApp extends Application{ public static void main( String[] args ) { launch(args); }
添加回答
舉報
0/150
提交
取消