-
Notifications
You must be signed in to change notification settings - Fork 0
/
Display2.java
125 lines (103 loc) · 3.59 KB
/
Display2.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import javafx.scene.Group;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.geometry.VPos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Border;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.BorderStroke;
import javafx.scene.layout.BorderStrokeStyle;
import javafx.scene.layout.BorderWidths;
import javafx.scene.layout.CornerRadii;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
public class Display2 extends Application
{
public static void main(String[] args)
{
Application.launch(args);
}
// PLAN:
// border pane
// hbox (top) --> CENTER (title)
// left column --> best match1
// left center --> best match 2
// right center --> worst match 1
// right column --> worst match 2
@Override
public void start(Stage stage) throws Exception
{
GridPane grid = new GridPane();
grid.setHgap(50);
grid.setVgap(50);
grid.setPadding(new Insets(0, 15, 0, 15));
// BEST MATCH1 in column 1, row 2
Text label1 = new Text("Best Match 1");
label1.setFont(Font.font("Arial", FontWeight.MEDIUM, 20));
grid.add(label1, 0, 2);
Text bm1 = new Text(new Matches().bestMatch1());
bm1.setFont(Font.font("Arial", FontWeight.MEDIUM, 15));
grid.add(bm1, 0, 3);
// TITLE in column 3, row 1
Text title = new Text();
title.setFont(Font.font("verdana", FontWeight.BOLD, FontPosture.REGULAR, 50));
DropShadow ds = new DropShadow();
ds.setOffsetY(3.0f);
title.setEffect(ds);
title.setText("BYNDER MATCHES");
// title.setTextAlignment(TextAlignment.CENTER);
grid.add(title, 1, 1, 3, 1);
// BEST MATCH2 in column 2, row 2
Text label2 = new Text("Best Match 2");
label2.setFont(Font.font("Arial", FontWeight.MEDIUM, 20));
grid.add(label2, 1, 2);
Text bm2 = new Text(new Matches().bestMatch2());
bm2.setFont(Font.font("Arial", FontWeight.MEDIUM, 15));
grid.add(bm2, 1, 3);
// WORST MATCH1 in column 3, row 2
Text label3 = new Text("Worst Match 1");
label3.setFont(Font.font("Arial", FontWeight.MEDIUM, 20));
grid.add(label3, 2, 2);
Text wm1 = new Text(new Matches().worstMatch1());
wm1.setFont(Font.font("Arial", FontWeight.MEDIUM, 15));
grid.add(wm1, 2, 3);
// WORST MATCH2 in column 4, row 2
Text label4 = new Text("Worst Match 2");
label4.setFont(Font.font("Arial", FontWeight.MEDIUM, 20));
grid.add(label4, 3, 2);
Text wm2 = new Text(new Matches().worstMatch2());
wm2.setFont(Font.font("Arial", FontWeight.MEDIUM, 15));
grid.add(wm2, 3, 3);
// Create the Scene
Scene scene = new Scene(grid);
scene.setFill(Color.LIGHTGOLDENRODYELLOW);
// Label idk = new Label();
// idk.setMaxWidth(Double.MAX_VALUE);
// Set the Properties of the Stage
stage.setX(100);
stage.setY(200);
stage.setMinHeight(300);
stage.setMinWidth(400);
// Add the scene to the Stage
stage.setScene(scene);
// Set the title of the Stage
stage.setTitle("Match Results");
// Display the Stage
stage.show();
}
}