private void invoiceAlert(String message) { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle("Invoice"); alert.setHeaderText(null); alert.setContentText(message); alert.getDialogPane().setStyle(" -fx-max-width:500px; -fx-pref-width: 500px;"); alert.show(); }
public void viewOrder() { String currentOrder = ""; int counter = 0; for (Item i : order.getOrder()) { counter++; currentOrder += counter + ". " + i.toString() + "\n"; } Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle("Current Order"); alert.setHeaderText("Your current order is as follows:"); alert.setContentText(currentOrder); alert.getDialogPane().setStyle(" -fx-max-width:500px; -fx-pref-width: 500px;"); alert.showAndWait(); }