-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from einaskoi/einar/startWindow
implement basic start screen without styling
- Loading branch information
Showing
3 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/edu/ntnu/idi/idatt2003/gruppe42/View/StartScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package edu.ntnu.idi.idatt2003.gruppe42.View; | ||
|
|
||
| import javafx.geometry.Pos; | ||
| import javafx.scene.control.Button; | ||
| import javafx.scene.control.Label; | ||
| import javafx.scene.control.TextField; | ||
| import javafx.scene.image.Image; | ||
| import javafx.scene.image.ImageView; | ||
| import javafx.scene.layout.StackPane; | ||
| import javafx.scene.layout.VBox; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class StartScreen { | ||
|
|
||
| public StackPane getRoot() { | ||
| // Root | ||
| StackPane root = new StackPane(); | ||
|
|
||
| // Main content | ||
| VBox content = new VBox(); | ||
| content.setAlignment(Pos.CENTER); | ||
|
|
||
| // Logo | ||
| Image logoImage = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/images/logo.jpg"))); | ||
| ImageView logoView = new ImageView(logoImage); | ||
| logoView.setPreserveRatio(true); | ||
| logoView.setFitWidth(250); | ||
|
|
||
| // User input content | ||
| VBox inputContent = new VBox(); | ||
| inputContent.setAlignment(Pos.CENTER); | ||
| inputContent.setMaxWidth(400); | ||
|
|
||
| Label usernameLabel = new Label("State your name, G"); | ||
| TextField usernameField = new TextField(); | ||
| Label startingMoneyLabel = new Label("How much matrix money?"); | ||
| TextField startingMoneyField = new TextField(); | ||
| Button loginButton = new Button("Login"); | ||
|
|
||
| // Set children | ||
| inputContent.getChildren().addAll(usernameLabel, usernameField, startingMoneyLabel, startingMoneyField); | ||
| content.getChildren().addAll(logoView, inputContent, loginButton); | ||
| root.getChildren().add(content); | ||
|
|
||
| return root; | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.