FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java/10-JavaFX/08.JavaFX-CSS/src/sample/Controller.java at main · taher-mulla/Java · GitHub
taher-mulla
/
Java
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java
/
10-JavaFX
/
08.JavaFX-CSS
/
src
/
sample
/
Controller.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
83 lines (65 loc) · 2.13 KB
Breadcrumbs
Java
/
10-JavaFX
/
08.JavaFX-CSS
/
src
/
sample
/
Controller.java
Copy path
File metadata and controls
83 lines (65 loc) · 2.13 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package
sample
;
import
javafx
.
fxml
.
FXML
;
import
javafx
.
scene
.
control
.
Button
;
import
javafx
.
scene
.
control
.
Label
;
import
javafx
.
scene
.
effect
.
DropShadow
;
import
javafx
.
scene
.
layout
.
GridPane
;
import
javafx
.
stage
.
FileChooser
;
import
java
.
io
.
File
;
import
java
.
util
.
List
;
public
class
Controller
{
@
FXML
private
Label
lable
;
@
FXML
private
Button
button4
;
@
FXML
private
GridPane
gridPane
;
public
void
initialize
(){
button4
.
setEffect
(
new
DropShadow
());
}
@
FXML
public
void
handleMouseEnter
(){
lable
.
setScaleX
(
2.0
);
lable
.
setScaleY
(
2.0
);
}
@
FXML
public
void
handleMouseExit
(){
lable
.
setScaleX
(
1.0
);
lable
.
setScaleY
(
1.0
);
}
@
FXML
public
void
handleClick
(){
// DirectoryChooser chooser = new DirectoryChooser();
// File file = chooser.showDialog(gridPane.getScene().getWindow());
// FileChooser chooser = new FileChooser();
// File file = chooser.showOpenDialog(gridPane.getScene().getWindow());
FileChooser
chooser
=
new
FileChooser
();
chooser
.
setTitle
(
"Save application file"
);
chooser
.
getExtensionFilters
().
addAll
(
new
FileChooser
.
ExtensionFilter
(
"Text"
,
"*.txt"
),
new
FileChooser
.
ExtensionFilter
(
"PDF"
,
"*.pdf"
),
new
FileChooser
.
ExtensionFilter
(
"Image files"
,
"*.png"
,
"*.gif"
,
"*.jpg"
),
new
FileChooser
.
ExtensionFilter
(
"All Files"
,
"*.*"
)
);
List
<
File
>
file
=
chooser
.
showOpenMultipleDialog
(
gridPane
.
getScene
().
getWindow
());
if
(
file
!=
null
){
for
(
int
i
=
0
;
i
<
file
.
size
();
i
++){
System
.
out
.
println
(
file
.
get
(
i
));
}
// System.out.println(file.getPath());
}
else
{
System
.
out
.
println
(
"Chooser was cancelled"
);
}
}
@
FXML
public
void
handleLinkClick
(){
System
.
out
.
println
(
"Link was clicked"
);
/* try{
Desktop.getDesktop().browse(new URI("http://www.javafc.com"));
}catch (IOException e){
e.printStackTrace();
}catch (URISyntaxException e){
e.printStackTrace();
}*/
}
}
Back
|
FazBrowse Home
|
New Git URL