我搜索了我的问题,但没有找到有效的解决方案。
我目前正在尝试使用 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);
}
森林海
相关分类