FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaFX/src/game/BallGame.java at master · rtirl/JavaFX · GitHub
rtirl
/
JavaFX
Public
forked from
dmpe/JavaFX
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaFX
/
src
/
game
/
BallGame.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (32 loc) · 1.1 KB
Breadcrumbs
JavaFX
/
src
/
game
/
BallGame.java
Copy path
File metadata and controls
39 lines (32 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package
game
;
import
java
.
io
.
IOException
;
import
javafx
.
application
.
Application
;
import
javafx
.
fxml
.
FXMLLoader
;
import
javafx
.
scene
.
Parent
;
import
javafx
.
scene
.
Scene
;
import
javafx
.
scene
.
SceneBuilder
;
import
javafx
.
scene
.
image
.
Image
;
import
javafx
.
scene
.
paint
.
Color
;
import
javafx
.
stage
.
Stage
;
public
class
BallGame
extends
Application
{
private
static
String
VIEW_GAME
=
"/resources/GameView.fxml"
;
private
static
String
STYLESHEET_FILE
=
"/resources/style.css"
;
public
static
Image
ICON
=
new
Image
(
BallGame
.
class
.
getResourceAsStream
(
"/resources/head.png"
));
@
Override
public
void
start
(
Stage
stage
)
throws
Exception
{
initGui
(
stage
);
}
private
void
initGui
(
Stage
stage
)
throws
IOException
{
Parent
root
=
FXMLLoader
.
load
(
getClass
().
getResource
(
VIEW_GAME
));
Scene
scene
=
SceneBuilder
.
create
().
root
(
root
).
width
(
500
).
height
(
530
)
.
fill
(
Color
.
GRAY
).
build
();
scene
.
getStylesheets
().
add
(
STYLESHEET_FILE
);
stage
.
setScene
(
scene
);
stage
.
setTitle
(
"hasCo de.com - Java FX 2 Ball Game Tutorial"
);
stage
.
getIcons
().
add
(
ICON
);
stage
.
show
();
}
public
static
void
main
(
String
...
args
) {
launch
(
args
);
}
}
Back
|
FazBrowse Home
|
New Git URL