Рет қаралды 169,501
Configure VS Code for JavaFX development. How to create your first JavaFX application using Visual Studio Code 2021.
################## Source Code ####################
******** Please replace "......" by the correct character ************
################################################
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class App extends Application {
@Override
public void start(Stage primaryStage) {
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler.....ActionEvent.....() {
@Override
public void handle(ActionEvent event) {
System.out.println("Hello World!");
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
/*
Parent root = FXMLLoader.load(getClass().getResource("MainScene.fxml"));
Scene scene = new Scene(root);
*/
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
} .
***********************************
🔥 Complete Udemy Courses :
ASP.NET MVC Course : www.udemy.com/...
ASP.NET Course : www.udemy.com/...
ASP.NET Core Web API : www.udemy.com/...
React JS : www.udemy.com/...
⬇️ Free Document Proofreading ⬇️
► Grammarly : grammarly.go2c...