当前位置: 首页>>代码示例>>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;未经允许,请勿转载。