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
6f8678a6
Commit
6f8678a6
authored
2 years ago
by
Anders Emil Bergan
Browse files
Options
Downloads
Patches
Plain Diff
finished starting point for javafx scenes
parent
8e979ce8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Merging the frontend baseline to get up to date with the progress
Pipeline
#202839
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/view/sceneController.java
+8
-5
8 additions, 5 deletions
...ain/java/no/ntnu/idatt1002/demo/view/sceneController.java
src/main/resources/view/NewBudget.fxml
+20
-10
20 additions, 10 deletions
src/main/resources/view/NewBudget.fxml
with
28 additions
and
15 deletions
src/main/java/no/ntnu/idatt1002/demo/view/sceneController.java
+
8
−
5
View file @
6f8678a6
...
...
@@ -4,6 +4,7 @@ import java.io.IOException;
import
javafx.event.ActionEvent
;
import
javafx.fxml.FXMLLoader
;
import
javafx.scene.Node
;
import
javafx.scene.Parent
;
import
javafx.scene.Scene
;
import
javafx.stage.Stage
;
...
...
@@ -14,18 +15,20 @@ public class sceneController {
private
Scene
scene
;
private
Parent
root
;
public
void
switchStartMenu
(
ActionEvent
event
)
throws
IOException
{
FXMLLoader
loader
=
new
FXMLLoader
(
getClass
().
getResource
(
"/view/FirstMenu.fxml"
));
Parent
root
=
loader
.
load
();
Scene
scene
=
new
Scene
(
root
);
root
=
loader
.
load
();
stage
=
(
Stage
)((
Node
)
event
.
getSource
()).
getScene
().
getWindow
();
scene
=
new
Scene
(
root
);
stage
.
setScene
(
scene
);
stage
.
show
();
}
public
void
switchNewBudget
(
ActionEvent
event
)
throws
IOException
{
FXMLLoader
loader
=
new
FXMLLoader
(
getC
lass
()
.
getResource
(
"/view/NewBudget.fxml"
));
FXMLLoader
loader
=
new
FXMLLoader
(
sceneController
.
c
lass
.
getResource
(
"/view/NewBudget.fxml"
));
Parent
root
=
loader
.
load
();
Scene
scene
=
new
Scene
(
root
);
stage
=
(
Stage
)((
Node
)
event
.
getSource
()).
getScene
().
getWindow
();
scene
=
new
Scene
(
root
);
stage
.
setScene
(
scene
);
stage
.
show
();
}
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/view/NewBudget.fxml
+
20
−
10
View file @
6f8678a6
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane
xmlns=
"http://javafx.com/javafx"
xmlns:fx=
"http://javafx.com/fxml"
fx:controller=
"no.ntnu.idatt1002.demo.view.NewBudget"
prefHeight=
"400.0"
prefWidth=
"600.0"
>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Text?>
<AnchorPane
prefHeight=
"400.0"
prefWidth=
"600.0"
xmlns=
"http://javafx.com/javafx/19"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"no.ntnu.idatt1002.demo.view.sceneController"
>
<children>
<ImageView
fitHeight=
"400.0"
fitWidth=
"600.0"
pickOnBounds=
"true"
>
<image>
<Image
url=
"@../Images/backgroundMini.jpg"
/>
</image>
</ImageView>
<ListView
layoutX=
"133.0"
layoutY=
"145.0"
prefHeight=
"233.0"
prefWidth=
"313.0"
/>
<TextArea
layoutX=
"133.0"
layoutY=
"97.0"
prefHeight=
"39.0"
prefWidth=
"276.0"
/>
<Button
layoutX=
"409.0"
layoutY=
"97.0"
mnemonicParsing=
"false"
prefHeight=
"39.0"
prefWidth=
"38.0"
text=
"+"
/>
<Text
layoutX=
"133.0"
layoutY=
"84.0"
strokeType=
"OUTSIDE"
strokeWidth=
"0.0"
text=
"Write your income here:"
/>
<Button
layoutX=
"14.0"
layoutY=
"14.0"
mnemonicParsing=
"false"
onAction=
"#switchStartMenu"
text=
"Back"
/>
</children>
</AnchorPane>
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