Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firefighter template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WILSON Danny adjete
Firefighter template
Commits
1f1bfca0
Commit
1f1bfca0
authored
Dec 1, 2023
by
Danny
Browse files
Options
Downloads
Patches
Plain Diff
change1 restart on new project
code App.java
parent
51d64ecd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/App.java
+49
-0
49 additions, 0 deletions
src/main/java/App.java
with
49 additions
and
0 deletions
src/main/java/App.java
0 → 100644
+
49
−
0
View file @
1f1bfca0
import
javafx.application.Application
;
import
javafx.scene.Group
;
import
javafx.scene.Scene
;
import
javafx.scene.control.Button
;
import
javafx.scene.layout.HBox
;
import
javafx.scene.layout.VBox
;
import
javafx.stage.Stage
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
public
class
App
extends
Application
{
boolean
isInPause
=
true
;
public
static
void
main
(
String
[]
args
)
{
launch
(
args
);
}
@Override
public
void
start
(
Stage
primaryStage
)
{
Group
root
=
new
Group
();
Button
restart
=
new
Button
(
"Restart"
);
Button
switchPause
=
new
Button
(
"Pause"
);
VBox
buttons
=
new
VBox
();
HBox
total
=
new
HBox
();
Grid
grid
=
new
Grid
(
700
,
700
,
20
,
20
);
root
.
getChildren
().
add
(
total
);
total
.
getChildren
().
add
(
buttons
);
total
.
getChildren
().
add
(
grid
);
buttons
.
getChildren
().
add
(
restart
);
buttons
.
getChildren
().
add
(
switchPause
);
restart
.
setOnMouseClicked
(
grid:
:
restart
);
switchPause
.
setOnMouseClicked
((
value
)->
isInPause
=
!
isInPause
);
primaryStage
.
setScene
(
new
Scene
(
root
));
primaryStage
.
show
();
grid
.
repaint
();
ScheduledThreadPoolExecutor
threadPoolExecutor
=
new
ScheduledThreadPoolExecutor
(
1
);
threadPoolExecutor
.
scheduleAtFixedRate
(()
->
{
if
(!
isInPause
)
{
grid
.
model
.
activation
();
grid
.
repaint
();
}
},
0
,
50
,
TimeUnit
.
MILLISECONDS
);
}
}
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