Erster Versuch mit Screen

This commit is contained in:
Lars Alteköster 2021-11-15 15:38:01 +01:00
parent 319ceab4d2
commit 9938c3c239
16 changed files with 31 additions and 22 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>

6
Happy_Bird/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="com.example.happy_bird.HappyBird"
prefHeight="400.0" prefWidth="600.0">
<VBox prefHeight="578.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.happy_bird.HappyBird">
<Label>Test</Label>
</AnchorPane>
<ImageView>
<image>
<Image url="@screen.png" />
</image>
</ImageView>
</VBox>

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -2,7 +2,11 @@ package com.example.happy_bird;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.image.*;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.stage.Stage;
import java.io.IOException;
@ -16,8 +20,8 @@ public class HappyBirdMain extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("happyBird.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
stage.setTitle("Hello!");
Scene scene = new Scene(fxmlLoader.load(), 578, 700);
stage.setTitle("HappyBird");
stage.setScene(scene);
stage.show();
}

View File

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="com.example.happy_bird.HappyBird"
prefHeight="400.0" prefWidth="600.0">
<VBox prefHeight="578.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.happy_bird.HappyBird">
<Label>Test</Label>
</AnchorPane>
<ImageView>
<image>
<Image url="@screen.png" />
</image>
</ImageView>
</VBox>

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB