gpt4 book ai didi

java - 为什么我的菜单栏不显示在此 vbox 布局中?

转载 作者:行者123 更新时间:2023-12-02 02:06:53 26 4
gpt4 key购买 nike

我有一个包含两行的 vbox 布局。第一行有一个菜单栏,第二行有一个 TabPane 布局。 Vbox 布局的第二行可见,第一行不出现。我提供了 fxml 以及渲染窗口的屏幕截图。我认为菜单栏应该位于顶部。 Rendered

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.input.*?>
<?import javafx.scene.effect.*?>
<?import javafx.scene.image.*?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.AnchorPane?>

<AnchorPane id="apConfig" fx:id="apConfig" prefHeight="440.0" prefWidth="598.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gui.ConfigController">
<padding>
<Insets bottom="5.0" right="5.0" top="5.0" />
</padding>
<children>
<VBox layoutY="1.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<MenuBar fx:id="mbrMainMenu" layoutY="1.0" visible="false" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem fx:id="mnuFileSave" mnemonicParsing="false" text="Save">
<accelerator>
<KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem fx:id="mnuFileExit" mnemonicParsing="false" onAction="#mnuFileExit_OnAction" text="Exit">
<accelerator>
<KeyCodeCombination alt="UP" code="X" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
</items>
</Menu>
</menus>
</MenuBar>
<TabPane layoutY="39.0" prefHeight="396.0" prefWidth="588.0" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="34.0">
<tabs>
<Tab text="Main">
<content>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField id="txtNeo4jDefaultPassword" fx:id="txtNeo4jDefaultPassword" layoutX="249.0" layoutY="64.0" prefHeight="25.0" prefWidth="174.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label layoutX="22.0" layoutY="37.0" text="Neo4j Default User" />
<TextField fx:id="txtMySQLDefaultPassword" layoutX="249.0" layoutY="238.0" prefHeight="25.0" prefWidth="174.0" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Label layoutX="22.0" layoutY="122.0" text="Neo4j Query To Table Label" GridPane.rowIndex="3" />
<Label layoutX="22.0" layoutY="68.0" text="Neo4j Default Password" GridPane.rowIndex="1" />
<Label layoutX="22.0" layoutY="95.0" text="Neo4j Table to Attribute Label" GridPane.rowIndex="2" />
<TextField id="txtNeo4jDefaultUser" fx:id="txtNeo4jDefaultUser" layoutX="249.0" layoutY="37.0" prefHeight="25.0" prefWidth="174.0" GridPane.columnIndex="1" />
<CheckBox fx:id="cbSupressOutputToConsole" layoutX="250.0" layoutY="382.0" mnemonicParsing="false" text="Suppress all output to the console" GridPane.columnIndex="1" GridPane.rowIndex="10" />
<Button fx:id="btnSave" layoutX="537.0" layoutY="432.0" mnemonicParsing="false" onAction="#btnSave_OnClick" text="Save" GridPane.columnIndex="2" GridPane.rowIndex="11" />
<TextArea fx:id="txaGrassURL" layoutX="249.0" layoutY="298.0" onMouseClicked="#txaCSVFolder_OnClick" prefHeight="55.0" prefWidth="257.0" promptText="Enter the URL of the GRASS file" GridPane.columnIndex="1" GridPane.rowIndex="8" />
<Label layoutX="22.0" layoutY="242.0" text="mySQL Default Password" GridPane.rowIndex="6" />
<CheckBox fx:id="cbUseTestData" layoutX="250.0" layoutY="359.0" mnemonicParsing="false" text="Use test queries (be careful!)" GridPane.columnIndex="1" GridPane.rowIndex="9" />
<Label layoutX="22.0" layoutY="270.0" text="mySQL Default Hostname" GridPane.rowIndex="7" />
<TextField fx:id="txtNeo4jTableToAttributeRelationName" layoutX="249.0" layoutY="91.0" prefHeight="25.0" prefWidth="174.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="txtMySQLDefaultHostname" layoutX="249.0" layoutY="266.0" prefHeight="25.0" prefWidth="174.0" GridPane.columnIndex="1" GridPane.rowIndex="7" />
<Label layoutX="22.0" layoutY="422.0" text="User Home Directory" GridPane.rowIndex="11" />
<TextField fx:id="txtMySQLDefaultLoginName" layoutX="249.0" layoutY="211.0" prefHeight="25.0" prefWidth="174.0" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<TextField fx:id="txtNeo4jQueryToTableRelationName" layoutX="249.0" layoutY="118.0" prefHeight="25.0" prefWidth="174.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label layoutX="22.0" layoutY="215.0" text="mySQL Default User Name" GridPane.rowIndex="5" />
<TextArea fx:id="txaCSVFolder" layoutX="249.0" layoutY="145.0" onMouseClicked="#txaCSVFolder_OnClick" prefHeight="55.0" prefWidth="257.0" promptText="Enter the import folder of the default Neo4j DB." GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label fx:id="lblCSVFolder" layoutX="19.0" layoutY="148.0" prefHeight="42.0" prefWidth="167.0" text="Default Destination Folder for CSV Files" wrapText="true" GridPane.rowIndex="4" />
<TextArea fx:id="txaUserHomeDirectory" editable="false" layoutX="249.0" layoutY="411.0" prefHeight="42.0" prefWidth="257.0" GridPane.columnIndex="1" GridPane.rowIndex="11" />
<Button fx:id="btnBrowseForCSVFolder" layoutX="512.0" layoutY="160.0" mnemonicParsing="false" onAction="#btnBrowseForCSVFolder_OnClick" text="..." GridPane.columnIndex="2" GridPane.rowIndex="4" />
<Label fx:id="lblGrassURL" layoutX="19.0" layoutY="301.0" prefHeight="42.0" prefWidth="167.0" text="URL for GRASS file (Style sheet)" wrapText="true" GridPane.rowIndex="8" />
</children>
</GridPane>
</content>
</Tab>
<Tab text="Neo4j" />
</tabs>
</TabPane>
</children>
</VBox>
</children>
</AnchorPane>

最佳答案

菜单栏标记中的可见属性设置为 false。将其更改为true

关于java - 为什么我的菜单栏不显示在此 vbox 布局中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50635555/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com