-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTester.java
44 lines (33 loc) · 1.19 KB
/
Tester.java
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
package disc;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Tester extends Application {
DragAdjustableLabel dragAdjustableLabel = new DragAdjustableLabel(10, 0, 100);
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.centerOnScreen();
primaryStage.setWidth(300);
primaryStage.setHeight(150);
// BorderPane
BorderPane root = new BorderPane();
// label
Label helpLabel = new Label("Hold and drag on the element below!");
root.setTop(helpLabel);
// Add some inline .css for the dragAdjustableLabel
// (you can also use external .css)
// -------------------------->check the DrgAdjustableLabel code--)
dragAdjustableLabel.setStyle(
"-fx-background-color:black; -fx-background-radius:15; -fx-text-fill:white; -fx-font-size:16; -fx-font-weight:bold;");
root.setCenter(dragAdjustableLabel);
primaryStage.setScene(new Scene(root));
primaryStage.show();
primaryStage.setOnCloseRequest(request -> Platform.exit());
}
public static void main(String[] args) {
launch(args);
}
}