-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTile.java
More file actions
46 lines (36 loc) · 1.08 KB
/
Tile.java
File metadata and controls
46 lines (36 loc) · 1.08 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
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import java.awt.GradientPaint;
import java.util.*;
class Tile extends StackPane {
private Text text = new Text();
public Tile(String value) {
Rectangle border = new Rectangle(30,30);
border.setFill(null);
border.setStroke(Color.BLACK);
// 0 represents the position can be edited
if(value.equals("0")){
text.setText("");
}
else {
text.setText(value);
}
text.setFont(Font.font(20));
setAlignment(Pos.CENTER);
getChildren().addAll(border,text);
}
public static void main(String[] args) {
}
}