This commit is contained in:
parent
e4478c878c
commit
49d2c5d7ab
35
Piece/src/application/Piece.java
Normal file
35
Piece/src/application/Piece.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package application;
|
||||||
|
import javafx.application.Application;
|
||||||
|
import javafx.scene.Group;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.shape.Polygon;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
public class Piece extends Application{
|
||||||
|
|
||||||
|
public void start(Stage primaryStage) throws Exception {
|
||||||
|
|
||||||
|
Polygon piece1 = new Polygon();
|
||||||
|
piece1.getPoints().addAll(new Double [] {
|
||||||
|
0.0,0.0,
|
||||||
|
200.0,0.0,
|
||||||
|
200.0,200.0,
|
||||||
|
100.0,200.0,
|
||||||
|
100.0,100.0,
|
||||||
|
0.0,100.0});
|
||||||
|
|
||||||
|
piece1.setFill(Color.LIMEGREEN);
|
||||||
|
piece1.setStroke(Color.BLACK);
|
||||||
|
|
||||||
|
Group root = new Group();
|
||||||
|
root.getChildren().addAll(piece1);
|
||||||
|
Scene scene = new Scene(root,490,450,Color.WHEAT);
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.setTitle("piece 1");
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user