javacleta.java 1.06 KB
Newer Older
roshka committed
1 2 3 4 5
package javacleta;

import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.layout.Pane; import javafx.stage.Stage; 
 
public class javacleta extends Application {     public static void main(String[] args)     {         Application.launch(args);     }     @Override     public void start(Stage stage)     {         Canvas canvas = new Canvas(400, 200);         GraphicsContext gc = canvas.getGraphicsContext2D();         gc.setLineWidth(2.0);         gc.strokeLine(200, 50, 300, 50);         Pane root = new Pane();         root.setStyle("-fx-padding: 10;" +                 "-fx-border-style: solid inside;" +                 "-fx-border-width: 2;" +  "-fx-border-insets: 5;" +                 "-fx-border-radius: 5;" +                 "-fx-border-color: blue;");         root.getChildren().add(canvas);         Scene scene = new Scene(root);         stage.setScene(scene);         stage.setTitle("Óyeme Carlos llévame en tu Bicicleta");         stage.show();     } }