Skip to content
Snippets Groups Projects
Commit 643f2b5b authored by Till's avatar Till
Browse files

added example images and first build for JavaFX

parent 4164aa66
No related branches found
No related tags found
1 merge request!1Dev
......@@ -26,7 +26,7 @@ tasks.withType(JavaCompile) {
application {
mainModule = 'de.uni_hannover.swt.tictactoe'
mainClass = 'de.uni_hannover.swt.tictactoe.HelloApplication'
mainClass = 'de.uni_hannover.swt.tictactoe.Main'
}
javafx {
......
......@@ -11,7 +11,7 @@ public class Main extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("hello-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
Scene scene = new Scene(fxmlLoader.load(), 600, 621);
stage.setTitle("Hello!");
stage.setScene(scene);
stage.show();
......
src/main/resources/de/uni_hannover/swt/tictactoe/O.png

21.2 KiB

src/main/resources/de/uni_hannover/swt/tictactoe/X.png

14.3 KiB

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<?import javafx.geometry.Rectangle2D?>
<?import javafx.scene.control.Button?>
<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml"
fx:controller="de.uni_hannover.swt.tictactoe.controller.MainController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
</padding>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.RowConstraints?>
<Label fx:id="welcomeText"/>
<Button text="Hello!" onAction="#onHelloButtonClick"/>
</VBox>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="621.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.uni_hannover.swt.tictactoe.controller.MainController">
<children>
<GridPane gridLinesVisible="true" layoutX="14.0" layoutY="24.0" prefHeight="573.0" prefWidth="573.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="191.0" minWidth="10.0" prefWidth="191.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="191.0" minWidth="0.0" prefWidth="191.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="191.0" minWidth="0.0" prefWidth="191.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button id="top-left" alignment="CENTER" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" />
<ImageView id="top-left_x" fitHeight="191.0" fitWidth="191.0" pickOnBounds="true">
<image>
<Image url="@X.png" />
</image>
<viewport>
<Rectangle2D />
</viewport>
</ImageView>
<ImageView id="top-left_o" disable="true" fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@O.png" />
</image></ImageView>
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.columnIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" />
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.columnIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" />
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.rowIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="1" />
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.rowIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="2" />
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Button layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="191.0" prefWidth="191.0" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<ImageView fitHeight="191.0" fitWidth="191.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" GridPane.rowIndex="2" />
</children>
</GridPane>
</children>
</Pane>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment