You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.3 KiB

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.collections.FXCollections?>
<?import java.lang.String?>
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="java6239.uml.DecimalController">
<center>
<GridPane hgap="10" vgap="10" alignment="center" style="-fx-padding: 20px;">
<!-- 第一行:选择输入进制 -->
<Label text="请选择输入数据的进制类型:" GridPane.rowIndex="0" GridPane.columnSpan="6" />
<ComboBox fx:id="inputBaseComboBox" GridPane.columnSpan="6" GridPane.rowIndex="1">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="2" />
<String fx:value="3" />
<String fx:value="4" />
<String fx:value="5" />
<String fx:value="6" />
<String fx:value="7" />
<String fx:value="8" />
<String fx:value="9" />
<String fx:value="10" />
<String fx:value="11" />
<String fx:value="12" />
<String fx:value="13" />
<String fx:value="14" />
<String fx:value="15" />
<String fx:value="16" />
</FXCollections>
</items>
</ComboBox>
<!-- 第二行:输入数据 -->
<Label text="请输入数据:" GridPane.rowIndex="2" />
<TextField fx:id="inputField" GridPane.columnSpan="6" GridPane.rowIndex="2" />
<!-- 第三行:转换成进制和转换按钮 -->
<Label text="转换成进制:" GridPane.rowIndex="3" />
<ComboBox fx:id="outputBaseComboBox" GridPane.columnIndex="1" GridPane.rowIndex="3">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="2" />
<String fx:value="3" />
<String fx:value="4" />
<String fx:value="5" />
<String fx:value="6" />
<String fx:value="7" />
<String fx:value="8" />
<String fx:value="9" />
<String fx:value="10" />
<String fx:value="11" />
<String fx:value="12" />
<String fx:value="13" />
<String fx:value="14" />
<String fx:value="15" />
<String fx:value="16" />
</FXCollections>
</items>
</ComboBox>
<Button text="转换" onAction="#convert" GridPane.rowIndex="3" GridPane.columnIndex="2" />
<!-- 第四行:输出结果 -->
<Label fx:id="resultLabel" text="" GridPane.rowIndex="4" GridPane.columnSpan="6" />
</GridPane>
</center>
</BorderPane>