Skip to content

Instantly share code, notes, and snippets.

@sedj601
Created January 16, 2024 15:58
Show Gist options
  • Save sedj601/c35982f23094747f86fcebe0d0254dc9 to your computer and use it in GitHub Desktop.
Save sedj601/c35982f23094747f86fcebe0d0254dc9 to your computer and use it in GitHub Desktop.
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.calculator.MainController">
<children>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0">
<children>
<Label alignment="CENTER_RIGHT" contentDisplay="RIGHT" maxWidth="1.7976931348623157E308" style="-fx-background-color: grey;" text="1,000">
<VBox.margin>
<Insets />
</VBox.margin>
<font>
<Font size="28.0" />
</font>
</Label>
<StackPane prefHeight="150.0" prefWidth="200.0">
<children>
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" vgap="10.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="25.0" prefWidth="75.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="25.0" prefWidth="75.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="25.0" prefWidth="75.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="25.0" prefWidth="75.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="50.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="50.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="50.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="50.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="50.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="7" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="8" GridPane.columnIndex="1" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="9" GridPane.columnIndex="2" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="/" GridPane.columnIndex="3" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="4" GridPane.rowIndex="1" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="5" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="6" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="*" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="1" GridPane.rowIndex="2" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="2" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="3" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="0" GridPane.columnSpan="2" GridPane.rowIndex="3" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="=" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="+" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="C" GridPane.columnIndex="1" GridPane.rowIndex="4">
<GridPane.margin>
<Insets />
</GridPane.margin>
</Button>
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Mod" GridPane.columnIndex="2" GridPane.rowIndex="4">
<GridPane.margin>
<Insets />
</GridPane.margin>
</Button>
</children>
<padding>
<Insets top="20.0" />
</padding>
</GridPane>
</children>
</StackPane>
</children>
<StackPane.margin>
<Insets />
</StackPane.margin>
<padding>
<Insets left="100.0" right="100.0" top="20.0" />
</padding>
</VBox>
</children>
</StackPane>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment