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


Java Dialog.setDialogPane方法代碼示例

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


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

示例1: create

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
/**
 * Create the dialog for choosing courses.
 *
 * @param courseList the list of courses to show in the dialog (let the user pick from them)
 * @return the controller of the dialog window, enabling to display the dialog and read the selected result
 */
public ChooseCourseController create(List<Course> courseList) {
    FXMLLoader fxmlLoader = this.fxmlLoader.get();
    DialogPane dialogPane = null;
    try (InputStream is = getClass().getResourceAsStream("ChooseCourseDialogPane.fxml")) {
        dialogPane = fxmlLoader.load(is);
    } catch (IOException e) {
        AlertCreator.handleLoadLayoutError(fxmlLoader.getResources(), e);
    }
    ChooseCourseController chooseCourseController = fxmlLoader.getController();
    chooseCourseController.setCourseList(courseList);
    Dialog<ButtonType> dialog = new Dialog<>();
    dialog.setDialogPane(dialogPane);
    chooseCourseController.setDialog(dialog);
    dialog.setTitle("StudyGuide");
    return chooseCourseController;
}
 
開發者ID:oskopek,項目名稱:StudyGuide,代碼行數:23,代碼來源:ChooseCourseDialogPaneCreator.java

示例2: create

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
/**
 * Create the dialog for entering a String.
 *
 * @param prompt the string message to prompt the user with
 * @return the controller of the dialog window, enabling to display the dialog and read the selected result
 */
public EnterStringController create(String prompt) {
    FXMLLoader fxmlLoader = this.fxmlLoader.get();
    DialogPane dialogPane = null;
    try (InputStream is = getClass().getResourceAsStream("EnterStringDialogPane.fxml")) {
        dialogPane = fxmlLoader.load(is);
    } catch (IOException e) {
        AlertCreator.handleLoadLayoutError(fxmlLoader.getResources(), e);
    }
    dialogPane.setHeaderText(prompt);
    EnterStringController enterStringController = fxmlLoader.getController();
    Dialog<ButtonType> dialog = new Dialog<>();
    dialog.initModality(Modality.APPLICATION_MODAL);
    dialog.setDialogPane(dialogPane);
    enterStringController.setDialog(dialog);
    dialog.setTitle("StudyGuide");
    dialog.setOnShown(event -> enterStringController.getTextField().requestFocus());
    return enterStringController;
}
 
開發者ID:oskopek,項目名稱:StudyGuide,代碼行數:25,代碼來源:EnterStringDialogPaneCreator.java

示例3: show

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
static void show(Window window) {
  try {
    Pair<OptionsController, DialogPane> pair = Util.renderFxml(OptionsController.class);
    Dialog<Void> dialog = new Dialog<>();
    dialog.initOwner(window);
    dialog.setDialogPane(pair.getValue());
    dialog.show();
  } catch (IOException e) {
    e.printStackTrace();
  }
}
 
開發者ID:XDean,項目名稱:CSS-Editor-FX,代碼行數:12,代碼來源:OptionsController.java

示例4: openAboutDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
private void openAboutDialog(ActionEvent actionEvent) {
    Dialog dialog = new Dialog();
    AboutDialogPane pane = new AboutDialogPane();
    dialog.setTitle("About");
    dialog.setDialogPane(pane);

    dialog.showAndWait();
}
 
開發者ID:VerifAPS,項目名稱:stvs,代碼行數:9,代碼來源:StvsMenuBarController.java


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