Posts

Showing posts with the label alert

Open another window on clicking OK button of Alert in JavaFX

Image
Clash Royale CLAN TAG #URR8PPP Open another window on clicking OK button of Alert in JavaFX private void showAlert(Alert.AlertType alertType, Window owner, String title, String message) { Alert alert = new Alert(alertType); alert.setTitle(title); alert.setHeaderText(null); alert.setContentText(message); alert.initOwner(owner); //alert.show(); Optional<ButtonType> result = alert.showAndWait(); if ((result.isPresent()) && (result.get() == ButtonType.OK)) { System.out.println("ALL OK..!"); //Open another window on clicking the OK button } } On this particular section, on clicking OK button, I want to open another window. Usually Button type is used for which an event can be defined by buttonName.setOnAction( event -> { //Action to do } ); Now how do I define this OK as a button Type? ...

How can I put an input in the alert() box?

Image
Clash Royale CLAN TAG #URR8PPP How can I put an input in the alert() box? I have a question that i want to insert an input in an a alert box, what thing I have to do for arriving to the result, I need an another tag, attrib, special properities, etc... Thanks. I think coud be like this: <!DOCTYPE html> <html> <head> <title>example</title> </head> <body> <script type="text/javascript"> alert("<input></input>"); </script> </body> </html> I think you need prompt : w3schools.com/jsref/met_win_prompt.asp – juzraai 12 secs ago prompt By clicking "Post Your Answer", you acknowledge that you have read our updated terms ...