Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt1002_2023_9
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Kluge Svendsrud
idatt1002_2023_9
Commits
3690d23f
Commit
3690d23f
authored
2 years ago
by
Anders Emil Bergan
Browse files
Options
Downloads
Patches
Plain Diff
small test for a UI window
parent
275dea65
Branches
feature/userprofile-for-foreign-users
Branches containing commit
No related tags found
1 merge request
!6
Merging the frontend baseline to get up to date with the progress
Pipeline
#201334
passed
2 years ago
Stage: build
Stage: test
Stage: package
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/no/ntnu/idatt1002/demo/UI.java
+74
-0
74 additions, 0 deletions
src/main/java/no/ntnu/idatt1002/demo/UI.java
src/main/resources/Defaults/Journey.png
+0
-0
0 additions, 0 deletions
src/main/resources/Defaults/Journey.png
with
74 additions
and
0 deletions
src/main/java/no/ntnu/idatt1002/demo/UI.java
0 → 100644
+
74
−
0
View file @
3690d23f
package
no.ntnu.idatt1002.demo
;
import
javafx.application.Application
;
import
javafx.geometry.Pos
;
import
javafx.scene.Scene
;
import
javafx.scene.control.Button
;
import
javafx.scene.image.Image
;
import
javafx.scene.image.ImageView
;
import
javafx.scene.layout.*
;
import
javafx.stage.Stage
;
import
javafx.scene.control.Label
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
public
class
UI
extends
Application
{
@Override
public
void
start
(
Stage
stage
)
throws
Exception
{
Label
label
=
new
Label
(
"Title"
);
VBox
rootV
=
new
VBox
();
HBox
rootH
=
new
HBox
();
Scene
scene
=
new
Scene
(
rootH
,
500
,
500
);
Button
btnNormal
=
new
Button
(
"_Normal"
);
Button
btnDefault
=
new
Button
(
"_Default"
);
Button
btnCancel
=
new
Button
(
"_Cancel"
);
btnDefault
.
setDefaultButton
(
true
);
btnCancel
.
setCancelButton
(
true
);
btnNormal
.
setOnAction
(
event
->{
normalButton
();
});
btnDefault
.
setOnAction
(
event
->{
defaultButton
();
});
btnCancel
.
setOnAction
(
event
->{
cancelButton
();
});
ImageView
bck
=
new
ImageView
(
new
Image
(
new
FileInputStream
(
"src/main/resources/Defaults/Journey.png"
)));
rootH
.
getChildren
().
add
(
bck
);
rootH
.
getChildren
().
addAll
(
btnNormal
,
btnDefault
,
btnCancel
);
rootH
.
setAlignment
(
Pos
.
BOTTOM_CENTER
);
rootH
.
setSpacing
(
10
);
rootV
.
getChildren
().
add
(
rootH
);
stage
.
setScene
(
scene
);
stage
.
setTitle
(
"Menu"
);
stage
.
show
();
}
private
void
normalButton
(){
System
.
out
.
println
(
"Button activated for normal"
);
}
private
void
defaultButton
(){
System
.
out
.
println
(
"Button activated for default"
);
}
private
void
cancelButton
(){
System
.
out
.
println
(
"Button activated for cancel"
);
}
public
static
void
main
(
String
[]
args
)
{
launch
(
args
);
}
}
This diff is collapsed.
Click to expand it.
src/main/resources/Defaults/Journey.png
0 → 100644
+
0
−
0
View file @
3690d23f
831 KiB
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment