1
FXML布局空间的工具栏元素ChatbotView.fxmlJavaFX的:试图均匀地FXML
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.ToolBar?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.text.Font?>
<BorderPane id="background" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="706.0" stylesheets="@ChatbotStyle.css" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
<top>
<ToolBar prefHeight="40.0" prefWidth="200.0" styleClass="spacer" BorderPane.alignment="CENTER">
<items>
<Button mnemonicParsing="false" text="Calendar">
<font>
<Font size="14.0" />
</font></Button>
<Button mnemonicParsing="false" text="Topic List">
<font>
<Font size="14.0" />
</font></Button>
<TextField>
<font>
<Font size="14.0" />
</font></TextField>
<Button mnemonicParsing="false" text="Chatbot's Button">
<font>
<Font size="14.0" />
</font></Button>
<Button mnemonicParsing="false" text="Quit">
<font>
<Font size="14.0" />
</font></Button>
</items>
</ToolBar>
</top>
<bottom>
<ToolBar prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<items>
<Button mnemonicParsing="false" text="Map">
<font>
<Font size="14.0" />
</font></Button>
<Button mnemonicParsing="false" text="Load from File">
<font>
<Font size="14.0" />
</font></Button>
<Button mnemonicParsing="false" text="Save to File">
<font>
<Font size="14.0" />
</font></Button>
<Button mnemonicParsing="false" text="Send Tweet">
<font>
<Font size="14.0" />
</font></Button>
<Button mnemonicParsing="false" text="Search Twitter">
<font>
<Font size="14.0" />
</font></Button>
</items>
</ToolBar>
</bottom>
</BorderPane>
我只是想弄清楚如何均匀地空间中的所有工具栏元素,因此最终看起来是这样的:
在此先感谢。
谢谢! CSS代码的变化绝对没有办法。 –