- import javafx.application.Application;
- import javafx.scene.Group;
- import javafx.scene.Scene;
- import javafx.scene.paint.Color;
- import javafx.scene.shape.Rectangle;
- import javafx.scene.shape.Polygon;
- import javafx.stage.Stage;
- public class PirateShip extends Application {
- @Override
- public void start(Stage stage) {
- Group root = new Group();
- Rectangle shipBody = new Rectangle(100, 75, 200, 150);
- shipBody.setFill(Color.BROWN);
- root.getChildren().add(shipBody);
- Polygon shipSail = new Polygon();
- shipSail.getPoints().addAll(new Double[]{
- 250.0, 75.0,
- 300.0, 125.0,
- 200.0, 125.0
- });
- shipSail.setFill(Color.WHITE);
- root.getChildren().add(shipSail);
- Scene scene = new Scene(root, 400, 250);
- stage.setScene(scene);
- stage.show();
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
[text] iii
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new:
File Description
- iii
- Paste Code
- 04 Feb-2023
- 910 Bytes
You can Share it:
Latest Code Pastes