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.

27 lines
1.4 KiB

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<AnchorPane id="CalculatorRoot" prefHeight="400.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/17.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label layoutX="20.0" layoutY="20.0" text="第一个数字:" />
<TextField fx:id="firstNumberField" layoutX="120.0" layoutY="20.0" prefWidth="200.0" />
<Label layoutX="20.0" layoutY="60.0" text="第二个数字:" />
<TextField fx:id="secondNumberField" layoutX="120.0" layoutY="60.0" prefWidth="200.0" />
<HBox layoutX="20.0" layoutY="100.0" spacing="10.0" alignment="center">
<Button fx:id="addButton" mnemonicParsing="false" text="+" />
<Button fx:id="subtractButton" mnemonicParsing="false" text="-" />
<Button fx:id="multiplyButton" mnemonicParsing="false" text="*" />
<Button fx:id="divideButton" mnemonicParsing="false" text="/" />
<Button fx:id="moduloButton" mnemonicParsing="false" text="%" />
</HBox>
<Label layoutX="20.0" layoutY="150.0" text="结果:" />
<TextField fx:id="resultField" layoutX="120.0" layoutY="150.0" prefWidth="200.0" promptText="请输入数字并选择操作" />
</children>
</AnchorPane>