-
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 #3 from danieskj/danieskj/testing_javafx
Danieskj/testing javafx
- Loading branch information
Showing
6 changed files
with
75 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,44 @@ | ||
| package edu.ntnu.idi.idatt.gui; | ||
|
|
||
| import javafx.application.Application; | ||
| import javafx.scene.Group; | ||
| import javafx.scene.Scene; | ||
| import javafx.scene.control.Button; | ||
| import javafx.scene.image.Image; | ||
| import javafx.scene.image.ImageView; | ||
| import javafx.scene.paint.Color; | ||
| import javafx.stage.Stage; | ||
|
|
||
| import java.awt.*; | ||
| import java.io.IOException; | ||
|
|
||
| public class javafx extends Application { | ||
| @Override | ||
| public void start (Stage stage) throws IOException { | ||
| Image stonk = new Image(getClass().getResource("/edu.ntnu.idi.idatt/stonks.png").toExternalForm()); | ||
| Button week = new Button("Week 5: Play"); | ||
| week.setPrefSize(150, 50); | ||
| week.setTranslateX(565); | ||
| Button logo = new Button(); | ||
| Button user = new Button(); | ||
| ImageView user_image = new ImageView(new Image(getClass().getResource("/edu.ntnu.idi.idatt/user.png").toExternalForm())); | ||
| ImageView logo_image = new ImageView(new Image(getClass().getResource("/edu.ntnu.idi.idatt/logo.png").toExternalForm())); | ||
| logo_image.setFitHeight(100); | ||
| logo_image.setFitWidth(100); | ||
| user_image.setFitHeight(100); | ||
| user_image.setFitWidth(100); | ||
| logo.setGraphic(logo_image); | ||
| user.setGraphic(user_image); | ||
| user.setTranslateX(1170); | ||
| ImageView stonks = new ImageView(stonk); | ||
| stonks.setX(440); | ||
| stonks.setY(220); | ||
| Group noe = new Group(stonks, week, logo, user); | ||
| Scene scene1 = new Scene(noe, 1280, 720, Color.DEEPSKYBLUE); | ||
| logo.setOnAction(e -> stage.setScene(new Scene(new Group(stonks,week,logo,user),1280, 720, Color.DEEPSKYBLUE))); | ||
| user.setOnAction(e -> stage.setScene(new Scene(new Group(logo,user),1280, 720, Color.BLACK))); | ||
| week.setOnAction(e -> stage.close()); | ||
| stage.setScene(scene1); | ||
| stage.show(); | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.