/
shabil
/
project
Обзор
Документация
Войти
/
shabil
/
project
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/example/notes/HelloApplication.java
56 строк
2 KB
shabil
код Сони
27 июн 2024, 07:37
27 июн 2024, 07:37
e6a969c
Код
Авторство
О чём код?
package com.example.notes; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class HelloApplication extends Application { @Override public void start(Stage primaryStage) { primaryStage.setTitle("ПРИЛОЖЕНИЕ"); Button button1 = new Button("1 ТИП"); button1.setOnAction(e -> openNewWindow("1 ТИП")); Button button2 = new Button("2 ТИП"); button2.setOnAction(e -> openNewWindow("2 ТИП")); Button button3 = new Button("3 ТИП"); button3.setOnAction(e -> openNewWindow("3 ТИП")); Button button4 = new Button("НАСТРОЙКИ"); button4.setOnAction(e -> openNewWindow("НАСТРОЙКИ")); Button button5 = new Button("РАСПИСАНИЕ"); button5.setOnAction(e -> openNewWindow("РАСПИСАНИЕ")); VBox layout = new VBox(10); layout.getChildren().addAll(button1, button2, button3, button4, button5); Scene scene = new Scene(layout, 320, 240); primaryStage.setScene(scene); primaryStage.show(); } private void openNewWindow(String windowName) { Stage newWindow = new Stage(); newWindow.setTitle(windowName); Button closeButton = new Button("Close"); closeButton.setOnAction(e -> newWindow.close()); VBox newLayout = new VBox(10); newLayout.getChildren().add(closeButton); Scene newScene = new Scene(newLayout, 200, 100); newWindow.setScene(newScene); newWindow.show(); } public static void main(String[] args) { launch(); } }