Startbildschirm auf Code-Behind
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -3,7 +3,7 @@
 | 
				
			|||||||
<?import javafx.scene.image.*?>
 | 
					<?import javafx.scene.image.*?>
 | 
				
			||||||
<?import javafx.scene.layout.*?>
 | 
					<?import javafx.scene.layout.*?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<VBox prefHeight="800.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">
 | 
					<StackPane prefHeight="800.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" back >
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <ImageView>
 | 
					    <ImageView>
 | 
				
			||||||
        <image>
 | 
					        <image>
 | 
				
			||||||
@@ -11,4 +11,4 @@
 | 
				
			|||||||
        </image>
 | 
					        </image>
 | 
				
			||||||
    </ImageView>
 | 
					    </ImageView>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</VBox>
 | 
					</StackPane>
 | 
				
			||||||
 
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							@@ -19,10 +19,29 @@ public class HappyBirdMain extends Application {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void start(Stage stage) throws IOException {
 | 
					    public void start(Stage stage) throws IOException {
 | 
				
			||||||
        FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("happyBird.fxml"));
 | 
					        /*FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("happyBird.fxml"));
 | 
				
			||||||
        Scene scene = new Scene(fxmlLoader.load(), 800, 700);
 | 
					        Scene scene = new Scene(fxmlLoader.load(), 800, 700);
 | 
				
			||||||
        stage.setTitle("HappyBird");
 | 
					        stage.setTitle("HappyBird");
 | 
				
			||||||
        stage.setScene(scene);
 | 
					        stage.setScene(scene);
 | 
				
			||||||
 | 
					        stage.show();*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        StackPane stackPane = new StackPane();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Scene scene = new Scene(stackPane, 800, 700);
 | 
				
			||||||
 | 
					        stage.setTitle("Happy Bird");
 | 
				
			||||||
 | 
					        stage.setScene(scene);
 | 
				
			||||||
 | 
					        Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background.png");
 | 
				
			||||||
 | 
					        BackgroundImage backgroundImageImg = new BackgroundImage(
 | 
				
			||||||
 | 
					                image,
 | 
				
			||||||
 | 
					                BackgroundRepeat.NO_REPEAT,
 | 
				
			||||||
 | 
					                BackgroundRepeat.NO_REPEAT,
 | 
				
			||||||
 | 
					                BackgroundPosition.DEFAULT,
 | 
				
			||||||
 | 
					                BackgroundSize.DEFAULT
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Background background = new Background(backgroundImageImg);
 | 
				
			||||||
 | 
					        stackPane.setBackground(background);
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        stage.show();
 | 
					        stage.show();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@
 | 
				
			|||||||
<?import javafx.scene.image.*?>
 | 
					<?import javafx.scene.image.*?>
 | 
				
			||||||
<?import javafx.scene.layout.*?>
 | 
					<?import javafx.scene.layout.*?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<VBox prefHeight="800.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">
 | 
					<StackPane prefHeight="800.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" back >
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <ImageView>
 | 
					    <ImageView>
 | 
				
			||||||
        <image>
 | 
					        <image>
 | 
				
			||||||
@@ -11,4 +11,4 @@
 | 
				
			|||||||
        </image>
 | 
					        </image>
 | 
				
			||||||
    </ImageView>
 | 
					    </ImageView>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</VBox>
 | 
					</StackPane>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user