Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Shapes extends Application implements EventHandler<ActionEvent> {
- public static void main(String[] args) {
- Application.launch(args);
- }
- @Override
- public void start(Stage stage)
- {
- TextField T1 = new TextField();
- TextField T2 = new TextField();
- HBox H1 = new HBox(T1);
- H1.setLayoutX(150);
- H1.setLayoutY(300);
- H1.setMaxWidth(75);
- HBox H2 = new HBox(T2);
- H2.setLayoutX(262);
- H2.setLayoutY(300);
- H2.setMaxWidth(75);
- Button BM = new Button();
- BM.setText("GENERATE SHAPE");
- BM.setLayoutX(190);
- BM.setLayoutY(350);
- Text caption1 = new Text(50, 50, "ENTER SHAPE");
- caption1.setLayoutX(101);
- caption1.setLayoutY(245);
- Text caption2 = new Text(100, 100, "ENTER COLOUR");
- caption2.setLayoutX(156.5);
- caption2.setLayoutY(195.4);
- Text Header = new Text ("SHAPE GENERATOR");
- Header.setTextAlignment(TextAlignment.CENTER);
- Header.setLayoutY(50);
- Header.setLayoutX(146);
- Header.setFont(Font.font("Verdana", 20));
- Header.setFill(Color.DARKCYAN);
- Text Instruction = new Text("Once you choose your shape and shape colour, press \"GENERATE SHAPE\" to create your shape");
- Instruction.setTextAlignment(TextAlignment.CENTER);
- Instruction.setLayoutY(70);
- Instruction.setLayoutX(1.5);
- Instruction.setFont(Font.font("Verdana", 10));
- Rectangle R = new Rectangle(50,50,50,100);
- R.setStroke(Color.BLACK);
- Circle C = new Circle(50, 50, 80);
- C.setStroke(Color.BLACK);
- Arc A = new Arc (125, 100, 100, 100, 90, 50);
- A.setStroke(Color.BLACK);
- A.setType(ArcType.CHORD);
- VBox V1 = new VBox();
- V1.setLayoutX(242);
- V1.setLayoutY(170);
- V1.setScaleX(24);
- V1.setScaleY(24);
- BorderStroke stroke1 = new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, new CornerRadii(0), new BorderWidths(4));
- V1.setBorder(new Border(stroke1));
- //BM.setOnAction
- Group root = new Group(H1, H2, caption1, caption2, BM, Header, Instruction);
- Scene scene = new Scene(root, Color.LIGHTGREY);
- stage.setTitle ("Shapes");
- stage.setScene(scene);
- stage.show();
- stage.setWidth(500);
- stage.setHeight(500);
- stage.setResizable(false);
- }
- @Override
- public void handle(ActionEvent event)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement