import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class MessageBox {
	MessageBox(String title, String message){
		BorderPane border = new BorderPane();
		
		StackPane stack = new StackPane();
		
		Text msg = new Text(message);
		//msg.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
		stack.getChildren().add(msg);
		
		
		StackPane bstack = new StackPane();
		bstack.setPadding(new Insets(0, 12, 30, 12));
		
		Button btn = new Button("OK");
		
		btn.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent e) {
            	Stage stage = (Stage) btn.getScene().getWindow();
                stage.close();
            }
        });
		
		
		bstack.getChildren().add(btn);
		
		border.setCenter(stack);
		border.setBottom(bstack);
		
		Stage stage = new Stage();
		stage.setTitle(title);
	    stage.setScene(new Scene(border, 300, 100));
	    stage.setResizable(false);
	    stage.setAlwaysOnTop(true);
	    stage.show();
	}
}
