Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package showcircle;
- import javafx.scene.paint.Color;
- import javafx.application.Application;
- import javafx.scene.Scene;
- import javafx.scene.layout.Pane;
- import javafx.scene.shape.Circle;
- import javafx.stage.Stage;
- /**
- *
- * @author Monty
- */
- public class ShowCircle extends Application{
- @Override
- public void start(Stage stage1){
- Pane pane = new Pane();
- Circle circle = new Circle();
- circle.centerXProperty().bind(pane.widthProperty().divide(2));
- circle.centerYProperty().bind(pane.heightProperty().divide(2));
- circle.setRadius(50);
- circle.setStroke(Color.BLACK);
- Color color = new Color(1,0.1,0.1,0.5);
- circle.setFill(color);
- pane.getChildren().add (circle);
- Scene scene = new Scene(pane, 200, 200);
- stage1.setTitle("MyJavaFX");
- stage1.setScene(scene);
- stage1.show();
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement