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


Java TextArea.setFocusTraversable方法代碼示例

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


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

示例1: createContent

import javafx.scene.control.TextArea; //導入方法依賴的package包/類
@Override
@FXThread
protected void createContent(@NotNull final VBox root) {
    super.createContent(root);

    final JFXApplication application = JFXApplication.getInstance();
    final HostServices hostServices = application.getHostServices();

    final GridPane gridPane = new GridPane();

    final Label applicationLabel = new Label(Config.TITLE);
    applicationLabel.setGraphic(new ImageView(Icons.APPLICATION_64));

    final Label versionLabel = new Label(Messages.ABOUT_DIALOG_VERSION + ":");
    versionLabel.prefWidthProperty().bind(gridPane.widthProperty().multiply(0.5));

    final Label versionField = new Label(Config.STRING_VERSION);

    final Label projectHomeLabel = new Label(Messages.ABOUT_DIALOG_PROJECT_HOME + ":");

    final Hyperlink projectHomeField = new Hyperlink("bitbucket.org");
    projectHomeField.setOnAction(event -> hostServices.showDocument(PROJECT_HOME));
    projectHomeField.setFocusTraversable(false);

    final Label forumThreadLabel = new Label(Messages.ABOUT_DIALOG_FORUM_THREAD + ":");

    final Hyperlink forumThreadField = new Hyperlink("hub.jmonkeyengine.org");
    forumThreadField.setOnAction(event -> hostServices.showDocument(FORUM_THREAD));
    forumThreadField.setFocusTraversable(false);

    final Label usedLibrariesLabel = new Label(Messages.ABOUT_DIALOG_USED_LIBRARIES + ":");
    usedLibrariesLabel.prefWidthProperty().bind(gridPane.widthProperty());

    final Label usedIcons = new Label(Messages.ABOUT_DIALOG_USED_ICONS + ":");
    usedIcons.prefWidthProperty().bind(gridPane.widthProperty());

    final TextArea librariesArea = new TextArea(LIBRARIES);
    librariesArea.setEditable(false);
    librariesArea.setFocusTraversable(false);

    final TextArea iconsArea = new TextArea(ICONS);
    iconsArea.setEditable(false);
    iconsArea.setFocusTraversable(false);

    gridPane.add(applicationLabel, 0, 0, 2, 1);
    gridPane.add(versionLabel, 0, 1, 1, 1);
    gridPane.add(versionField, 1, 1, 1, 1);
    gridPane.add(projectHomeLabel, 0, 2, 1, 1);
    gridPane.add(projectHomeField, 1, 2, 1, 1);
    gridPane.add(forumThreadLabel, 0, 3, 1, 1);
    gridPane.add(forumThreadField, 1, 3, 1, 1);
    gridPane.add(usedLibrariesLabel, 0, 4, 2, 1);
    gridPane.add(librariesArea, 0, 5, 2, 1);
    gridPane.add(usedIcons, 0, 6, 2, 1);
    gridPane.add(iconsArea, 0, 7, 2, 1);

    FXUtils.addToPane(gridPane, root);

    FXUtils.addClassTo(root, CSSClasses.ABOUT_DIALOG);
    FXUtils.addClassTo(gridPane, CSSClasses.DEF_GRID_PANE);
    FXUtils.addClassTo(usedLibrariesLabel, usedIcons, CSSClasses.ABOUT_DIALOG_LONG_LABEL);
    FXUtils.addClassesTo(versionLabel, projectHomeLabel, forumThreadLabel, usedLibrariesLabel, usedIcons,
            versionField, projectHomeField, forumThreadField, CSSClasses.SPECIAL_FONT_16);
    FXUtils.addClassTo(applicationLabel, CSSClasses.ABOUT_DIALOG_TITLE_LABEL);
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:66,代碼來源:AboutDialog.java


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