1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| package com.example.simpleproject;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class GUI extends Application {
@Override
public void start(Stage stage) throws Exception {
Rectangle LED = new Rectangle();
LED = new Rectangle();
LED.setWidth(50);
LED.setHeight(50);
LED.setFill(Color.RED);
BorderPane borderPane = new BorderPane(LED);
Scene scene = new Scene(borderPane, 300, 300);
stage.setTitle("Hello!");
stage.setScene(scene);
stage.show();
}
public void Lancer()
{
launch();
}
} |
Partager