當前位置: 首頁>>代碼示例>>Java>>正文


Java Alert.setHeaderText方法代碼示例

本文整理匯總了Java中javafx.scene.control.Alert.setHeaderText方法的典型用法代碼示例。如果您正苦於以下問題:Java Alert.setHeaderText方法的具體用法?Java Alert.setHeaderText怎麽用?Java Alert.setHeaderText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.Alert的用法示例。


在下文中一共展示了Alert.setHeaderText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onSubmitClicked

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
 * Action button for when submit button is clicked.
 *
 * @throws IOException
 */
public void onSubmitClicked() throws IOException {
    if (!feedbackTextArea.getText().isEmpty()
            && !guestEmailTextField.getText().isEmpty()) {

        GuestFeedbackService guestfeedbackservice = new GuestFeedbackService();
        guestfeedbackservice.createNewGuestFeedback(
            new GuestFeedback(feedbackTextArea.getText(), guestEmailTextField.getText())
        );

        // Display an alert dialog to confirm the submission.
        Alert a = new Alert(AlertType.INFORMATION);
        a.setTitle("Thanks!");
        a.setHeaderText("Thanks for your feedback. As promised, we will now ignore it.");
        a.showAndWait();
        if (a.getResult() == ButtonType.OK) {
            // User clicked OK
            onCancelClicked(); // This just closes the dialog, but it's a bit hacky
        }
    }
}
 
開發者ID:maillouxc,項目名稱:git-rekt,代碼行數:26,代碼來源:LeaveFeedbackScreenController.java

示例2: alertErrorConfirm

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public int alertErrorConfirm() {

		int r = 0;

		Alert alert = new Alert(AlertType.ERROR);
		alert.setTitle("경고");
		alert.setHeaderText(null);
		alert.setContentText(this.msg);
		alert.showAndWait();

		Optional<ButtonType> result = alert.showAndWait();
		if (result.get() == ButtonType.OK) {
			r = 1;
		}

		return r;

	}
 
開發者ID:kimyearho,項目名稱:WebtoonDownloadManager,代碼行數:19,代碼來源:AlertSupport.java

示例3: archiveSource

import javafx.scene.control.Alert; //導入方法依賴的package包/類
@FXML
private void archiveSource(ActionEvent event) {
	try {
		source.archiveSource(sourcecmboArchive.getValue());
		
		Alert confirmationMsg = new Alert(AlertType.INFORMATION);
		confirmationMsg.setTitle("Message");
		confirmationMsg.setHeaderText(null);
		confirmationMsg.setContentText(sourcecmboArchive.getValue()+ " is Archived Successfully");
		Stage SettingsStage = (Stage) btnDashboard.getScene().getWindow();
		confirmationMsg.setX(SettingsStage.getX() + 200);
		confirmationMsg.setY(SettingsStage.getY() + 170);
		confirmationMsg.showAndWait();
		
		tabSourceInitialize();
	} catch (Exception e) {}
}
 
開發者ID:krHasan,項目名稱:Money-Manager,代碼行數:18,代碼來源:SettingsController.java

示例4: recusarPedidoReserva

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
 * Mostra uma caixa de di�logo perguntando se o usu�rio realmente deseja
 * cancelar a solicita��o de reserva de hor�rio.
 */
private void recusarPedidoReserva() {
	Alert alerta = new Alert(Alert.AlertType.CONFIRMATION);
	ButtonType sim = new ButtonType("Sim");
	ButtonType nao = new ButtonType("N�o");
	alerta.setTitle("AlphaLab");
	alerta.setHeaderText("Cancelar pedido de Reserva de Hor�rio");
	alerta.setContentText("Deseja cancelar o pedido de Reserva de Hor�rio?");
	alerta.getButtonTypes().setAll(sim, nao);

	alerta.showAndWait().ifPresent(opcao -> {
		if (opcao == sim) {
			// this.tblRequisitos.getSelectionModel().getSelectedItem().setStatus(Enum.CANCELADA);
		}
		if (opcao == nao) {
		}
	});
}
 
開發者ID:dev-andremonteiro,項目名稱:AlphaLab,代碼行數:22,代碼來源:FrmSolicitarReservaHorarioPorRequisito.java

示例5: alertConfirm

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public int alertConfirm() {
	int r = 0;
	Alert alert = new Alert(AlertType.CONFIRMATION);
	alert.setTitle("확인 알림");
	alert.setHeaderText(null);
	alert.setContentText(this.msg);

	Optional<ButtonType> result = alert.showAndWait();
	if (result.get() == ButtonType.OK) {
		r = 1;
	}

	return r;
}
 
開發者ID:kimyearho,項目名稱:WebtoonDownloadManager,代碼行數:15,代碼來源:AlertSupport.java

示例6: createAlertDialog

import javafx.scene.control.Alert; //導入方法依賴的package包/類
private void createAlertDialog(DialogObject dialog) {
    Alert alert = new Alert(dialog.getType());
    alert.setTitle(dialog.getTitle());
    alert.setHeaderText(dialog.getHeader());
    alert.setContentText(dialog.getContent());

    if (dialog.getexception() == null) {
        alert.showAndWait();
    } else {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        dialog.getexception().printStackTrace(pw);
        String exceptionText = sw.toString();

        Label label = new Label("The exception stacktrace was:");

        TextArea textArea = new TextArea(exceptionText);
        textArea.setEditable(false);
        textArea.setWrapText(true);

        textArea.setMaxWidth(Double.MAX_VALUE);
        textArea.setMaxHeight(Double.MAX_VALUE);
        GridPane.setVgrow(textArea, Priority.ALWAYS);
        GridPane.setHgrow(textArea, Priority.ALWAYS);

        GridPane expContent = new GridPane();
        expContent.setMaxWidth(Double.MAX_VALUE);
        expContent.add(label, 0, 0);
        expContent.add(textArea, 0, 1);

        alert.getDialogPane().setExpandableContent(expContent);

        alert.showAndWait();
    }
}
 
開發者ID:PanagiotisDrakatos,項目名稱:EasyDragDrop,代碼行數:36,代碼來源:JFxBuilder.java

示例7: showRequired

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public void showRequired() {
    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle("Validation error");
    alert.setHeaderText("Validation error");
    alert.setContentText("Patient Name is Required \nPhone Number is Required \nDate or birth is required");
    alert.show();
}
 
開發者ID:kmrifat,項目名稱:Dr-Assistant,代碼行數:8,代碼來源:PatientBLL.java

示例8: mnuUndo

import javafx.scene.control.Alert; //導入方法依賴的package包/類
@FXML
private void mnuUndo(ActionEvent event) {
	Stage HelpStage = (Stage) btnSignOut.getScene().getWindow();
	Alert alert = new Alert(AlertType.CONFIRMATION);
	alert.setTitle("Action Failed");
	alert.setHeaderText("Undo Function Works Only From \"Make A Transaction\" and \"History\" Window");
	alert.setContentText("Press \"OK\" to go to \"Make A Transaction\" window");
	alert.setX(HelpStage.getX() + 60);
	alert.setY(HelpStage.getY() + 170);
	Optional<ButtonType> result = alert.showAndWait();
	if (result.get() == ButtonType.OK){
		(new TabAccess()).setTabName("tabGetMoney"); //name of which Tab should open
		(new GoToOperation()).goToMakeATransaction(HelpStage.getX(), HelpStage.getY());
		HelpStage.close();
	}
}
 
開發者ID:krHasan,項目名稱:Money-Manager,代碼行數:17,代碼來源:HelpController.java

示例9: showErrorDialog

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public static void showErrorDialog (String title, String content) {
    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle(title);
    alert.setHeaderText(null);
    alert.setContentText(content);

    alert.showAndWait();
}
 
開發者ID:open-erp-systems,項目名稱:erp-frontend,代碼行數:9,代碼來源:JavaFXUtils.java

示例10: onActionMenuItemAbout

import javafx.scene.control.Alert; //導入方法依賴的package包/類
@FXML
private void onActionMenuItemAbout(ActionEvent event) {
    Alert alert = new Alert(Alert.AlertType.INFORMATION);
    alert.setTitle("關於");
    alert.setHeaderText("集群設備模擬客戶端 " + KySetting.VERSION);
    alert.setGraphic(null);
    alert.setContentText(ViewUtil.getOsInfo());
    alert.showAndWait();
}
 
開發者ID:bitkylin,項目名稱:ClusterDeviceControlPlatform,代碼行數:10,代碼來源:MainView.java

示例11: buildAlert

import javafx.scene.control.Alert; //導入方法依賴的package包/類
private void buildAlert(ShowAlert msg, Alert alert) {
    alert.getDialogPane().getStylesheets().addAll(toolBox.getStylesheets());
    alert.setTitle(msg.getTitle());
    alert.setHeaderText(msg.getHeaderText());
    alert.setContentText(msg.getContentText());
    alert.getDialogPane()
            .getStylesheets()
            .addAll(toolBox.getStylesheets());
    alert.showAndWait();
}
 
開發者ID:mbari-media-management,項目名稱:vars-annotation,代碼行數:11,代碼來源:Alerts.java

示例12: showExceptionDialog

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public static void showExceptionDialog (String title, String content, Throwable e) {
    //Source: http://code.makery.ch/blog/javafx-dialogs-official/

    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle(title);
    alert.setHeaderText(null);
    alert.setContentText(content);

    // Create expandable Exception.
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    e.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");

    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    //set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();
}
 
開發者ID:leeks-and-dragons,項目名稱:dialog-tool,代碼行數:36,代碼來源:JavaFXUtils.java

示例13: showConfirmationDialog

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public static boolean showConfirmationDialog (String title, String content) {
    Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
    alert.setTitle(title);
    alert.setHeaderText(null);
    alert.setContentText(content);

    Optional<ButtonType> result = alert.showAndWait();

    return result.get() == ButtonType.OK;
}
 
開發者ID:open-erp-systems,項目名稱:erp-frontend,代碼行數:11,代碼來源:JavaFXUtils.java

示例14: handleExit

import javafx.scene.control.Alert; //導入方法依賴的package包/類
@FXML
private void handleExit() {
	Alert alert = new Alert(AlertType.CONFIRMATION);
	alert.setTitle("Confirm Exit");
	alert.setHeaderText("Exit Kanphnia2?");
	alert.setContentText("");

	Optional<ButtonType> result = alert.showAndWait();
	if (result.get() == ButtonType.OK){
		System.exit(0);
	} else {
	    // ... user chose CANCEL or closed the dialog
	}
}
 
開發者ID:yc45,項目名稱:kanphnia2,代碼行數:15,代碼來源:RootLayoutController.java

示例15: validationButtonClick

import javafx.scene.control.Alert; //導入方法依賴的package包/類
@FXML
public void validationButtonClick(Event evt) {
    boolean allGood = true;
    int count = 0;
    while (count < 6 && allGood == true) {
        ComboBox action = choiceBoxes.get(count);
        if (action.getValue() != null) {
            if (action.getValue().equals("Delegation")) {
                ComboBox region = regionBoxes.get(count);
                if (region.getValue() == null) {
                    allGood = false;
                }
            }
        } else {
            allGood = false;
        }
        count++;
    }

    if (allGood) {
        validateAndClose(evt);
    } else {
        Alert alert = new Alert(AlertType.ERROR);
        alert.setTitle("Pas de précipitation !");
        alert.setHeaderText(null);
        alert.setContentText("Vous devez choisir 6 actions !\nNe pas oublier de choisir la région pour les délégations.");
        alert.showAndWait();
    }
}
 
開發者ID:sebastienscout,項目名稱:Himalaya-JavaFX,代碼行數:30,代碼來源:ActionsFXMLController.java


注:本文中的javafx.scene.control.Alert.setHeaderText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。