import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane;
public class Main extends Application {
public void start(Stage stage) {
// في النافذة Root Node و الذي ننوي جعله الـ FlowPane هنا قمنا بإنشاء كائن من الكلاس
FlowPane root = new FlowPane();
// تظهر في وسطه root هنا جعلنا الأشياء التي نضيفها في الكائن
root.setAlignment(Pos.CENTER);
// و النافذة نفسها root هنا قمنا بإضافة هامش بمقدار 5 بيكسل بين الكائن
root.setPadding(new Insets(5));
// root هنا قمنا بإضافة هامش بمقدار 10 بيكسل أفقياً بين كل شيئين يتم إضافتهما في الكائن
// root هنا قمنا بإضافة هامش بمقدار 10 بيكسل عامودياً بين كل شيئين يتم إضافتهما في الكائن
// root هنا قمنا بإنشاء جميع الأشياء التي سنضيفها في الكائن
Button button1 = new Button("Button 1");
Button button2 = new Button("Button 2");
Button button3 = new Button("Button 3");
Button button4 = new Button("Button 4");
Button button5 = new Button("Button 5");
// root في الكائن button3 و button2 و button1 هنا قمنا بإضافة الكائنات
root.getChildren().addAll(button1, button2, button3, button4, button5);
// فيها و تحديد حجمها Node كأول root هنا قمنا بإنشاء محتوى النافذة مع تعيين الكائن
Scene scene = new Scene(root, 350, 250);
// هنا وضعنا عنوان للنافذة
stage.setTitle("JavaFX FlowPane");
// أي وضعنا محتوى النافذة الذي قمنا بإنشائه للنافذة .stage في كائن الـ scene هنا وضعنا كائن الـ
// هنا قمنا بإظهار النافذة
// هنا قمنا بتشغيل التطبيق
public static void main(String[] args) {
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane;
public class Main extends Application {
@Override
public void start(Stage stage) {
// في النافذة Root Node و الذي ننوي جعله الـ FlowPane هنا قمنا بإنشاء كائن من الكلاس
FlowPane root = new FlowPane();
// تظهر في وسطه root هنا جعلنا الأشياء التي نضيفها في الكائن
root.setAlignment(Pos.CENTER);
// و النافذة نفسها root هنا قمنا بإضافة هامش بمقدار 5 بيكسل بين الكائن
root.setPadding(new Insets(5));
// root هنا قمنا بإضافة هامش بمقدار 10 بيكسل أفقياً بين كل شيئين يتم إضافتهما في الكائن
root.setHgap(10);
// root هنا قمنا بإضافة هامش بمقدار 10 بيكسل عامودياً بين كل شيئين يتم إضافتهما في الكائن
root.setVgap(10);
// root هنا قمنا بإنشاء جميع الأشياء التي سنضيفها في الكائن
Button button1 = new Button("Button 1");
Button button2 = new Button("Button 2");
Button button3 = new Button("Button 3");
Button button4 = new Button("Button 4");
Button button5 = new Button("Button 5");
// root في الكائن button3 و button2 و button1 هنا قمنا بإضافة الكائنات
root.getChildren().addAll(button1, button2, button3, button4, button5);
// فيها و تحديد حجمها Node كأول root هنا قمنا بإنشاء محتوى النافذة مع تعيين الكائن
Scene scene = new Scene(root, 350, 250);
// هنا وضعنا عنوان للنافذة
stage.setTitle("JavaFX FlowPane");
// أي وضعنا محتوى النافذة الذي قمنا بإنشائه للنافذة .stage في كائن الـ scene هنا وضعنا كائن الـ
stage.setScene(scene);
// هنا قمنا بإظهار النافذة
stage.show();
}
// هنا قمنا بتشغيل التطبيق
public static void main(String[] args) {
launch(args);
}
}