-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaskerPaneTest.java
More file actions
48 lines (42 loc) · 1.45 KB
/
Copy pathMaskerPaneTest.java
File metadata and controls
48 lines (42 loc) · 1.45 KB
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
package application;
import org.controlsfx.control.MaskerPane;
import javafx.application.Application;
import javafx.concurrent.Task;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class MaskerPaneTest extends Application {
@Override
public void start(final Stage primaryStage) throws Exception {
final MaskerPane progressPane = new MaskerPane();
progressPane.setVisible(false);
final Button button = new Button("Show");
button.setOnAction(event -> {
final Task task = new Task<Void>() {
@Override
protected Void call() throws Exception {
progressPane.setVisible(true);
Thread.sleep(2000);
return null;
}
@Override
protected void succeeded(){
super.succeeded();
progressPane.setVisible(false);
}
};
new Thread(task).start();
});
final VBox box = new VBox(button, progressPane);
box.setAlignment(Pos.CENTER);
final Scene scene = new Scene(box, 200, 200);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(final String[] args)
{
Application.launch();
}
}