Created
April 20, 2015 13:49
-
-
Save darylwong/4005c06cbfe9ec34c1b0 to your computer and use it in GitHub Desktop.
Setting absolute position for Circle object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package javafxapplication12; | |
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.stage.Stage; | |
import javafx.scene.layout.Pane; | |
import javafx.scene.paint.Color; | |
import javafx.scene.shape.Circle; | |
public class CirclePosition extends Application { | |
@Override | |
public void start(Stage stage) { | |
stage.setTitle("Codecrawl.com"); | |
Pane pane = new Pane(); | |
Scene scene = new Scene(pane, 500, 400); | |
stage.setScene(scene); | |
pane.setStyle("-fx-background-color: lightgray;"); | |
Circle circle = new Circle(); | |
circle.setCenterX(120); | |
circle.setCenterY(250); | |
circle.setRadius(50); | |
circle.setFill(Color.CORNFLOWERBLUE); | |
pane.getChildren().add(circle); | |
stage.show(); | |
} | |
public static void main(String[] args) { | |
launch(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment