Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javafx.geometry.Pos;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.layout.VBox;
- import javafx.stage.Modality;
- import javafx.stage.Stage;
- public class AlertBox
- {
- public void display(String poruka, String naslov)
- {
- Stage abox = new Stage();
- abox.setTitle(naslov);
- abox.setMinHeight(250);
- abox.setMinWidth(250);
- abox.initModality(Modality.APPLICATION_MODAL);
- Label prk = new Label(poruka);
- Button button = new Button("Zatvori prozor");
- button.setOnAction(e -> abox.close());
- VBox layout = new VBox();
- layout.getChildren().addAll(prk, button);
- layout.setAlignment(Pos.CENTER);
- Scene scene = new Scene(layout , 250, 250);
- abox.setScene(scene);
- abox.showAndWait();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement