예제 #1
0
 public void showAbout() {
   Alert alert = new Alert(Alert.AlertType.INFORMATION);
   alert.setTitle("О программе");
   alert.setHeaderText("Grain");
   alert.setContentText("Программа для расчета цены за партию зерна.");
   alert.show();
 }
예제 #2
0
  private void confirmAlert() {
    Alert alert = new Alert(Alert.AlertType.INFORMATION);
    alert.setTitle("Item Accepted");
    alert.setHeaderText(null);
    alert.setContentText("Item #" + itemCount + " accepted.");

    alert.show();
  }
예제 #3
0
  private void bookNotFoundAlert(String id) {
    Alert alert = new Alert(Alert.AlertType.INFORMATION);
    alert.setTitle("Book Not on File!");
    alert.setHeaderText(null);
    alert.setContentText("Book ID: " + id + " is not in our inventory.");

    alert.show();
  }
예제 #4
0
  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();
  }
예제 #5
0
  public void exit() {
    Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
    alert.setTitle("Quit?");
    alert.setHeaderText("You've selected to quit this program.");
    alert.setContentText("Are you sure you want to quit?");

    Optional<ButtonType> result = alert.showAndWait();
    if (result.get() == ButtonType.OK) System.exit(0);
  }
예제 #6
0
  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();
  }