javafx.scene.control.Button.setFocusTraversable()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中javafx.scene.control.Button.setFocusTraversable()方法的一些代码示例,展示了Button.setFocusTraversable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setFocusTraversable()方法的具体详情如下:
包路径:javafx.scene.control.Button
类名称:Button
方法名:setFocusTraversable

Button.setFocusTraversable介绍

暂无

代码示例

代码示例来源:origin: org.tentackle/tentackle-fx

@Override
public void configure(T button) {
 // no super.configure: don't remap the keys
 // by default, buttons are not traversable in a desktop application
 button.setFocusTraversable(false);
}

代码示例来源:origin: com.aquafx-project/aquafx

button1.setFocusTraversable(false);
box.getChildren().add(button1);
Button button2 = new Button("b2");
button2.setFocusTraversable(false);
box.getChildren().add(button2);
Button button3 = new Button("b3");
button3.setFocusTraversable(false);
box.getChildren().add(button3);
mainbox.getChildren().add(box);
pbutton1.setFocusTraversable(false);
AquaFx.createButtonStyler().setType(ButtonType.LEFT_PILL).style(pbutton1);
box2.getChildren().add(pbutton1);
Button pbutton2 = new Button("b2");
pbutton2.setFocusTraversable(false);
AquaFx.createButtonStyler().setType(ButtonType.CENTER_PILL).style(pbutton2);
box2.getChildren().add(pbutton2);
Button pbutton3 = new Button("b3");
pbutton3.setFocusTraversable(false);
AquaFx.createButtonStyler().setType(ButtonType.RIGHT_PILL).style(pbutton3);
box2.getChildren().add(pbutton3);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

private void buildActions() {
 okButton.getStyleClass().addAll("flat-button", "transparent-focus");
 okButton.setFocusTraversable(false);
 okButton.setDefaultButton(true);
 okButton.setText(controller.getGLocalised("DONE_LABEL").toUpperCase());
 cancelButton.setFocusTraversable(false);

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

private void buildSearchFilter() {
 searchToolbar.setStyle("-fx-background-color: white;" + "-fx-alignment:CENTER_LEFT;" + "-fx-padding: 8 16 8 64;" + "-fx-spacing:16;" + "-fx-border-color: -grey-color-300;"
   + "-fx-border-width: 0 0 1 0;" + "-fx-pref-height: 48;");
 getChildren().addAll(searchToolbar);
 NodeHelper.setHgrow(searchToolbar);
 searchToolbar.managedProperty().bind(searchToolbar.visibleProperty());
 final CustomTextField customTextField = new CustomTextField();
 customTextField.setPrefWidth(350);
 final Button searchIconRight = new Button("Go");
 searchIconRight.setFocusTraversable(false);
 searchIconRight.setOnAction(e -> {
  Method method = null;
  try {
   method = controller.getClass().getMethod("runSearch", Event.class);
   method.invoke(controller, e);
  } catch (final Exception e1) {
   e1.printStackTrace();
  }
 });
 final Hyperlink searchToolBarButton = new Hyperlink();
 defaultToolbar.getChildren().add(searchToolBarButton);
 searchToolBarButton.setOnAction(e -> {
  searchToolbar.visibleProperty().set(!searchToolbar.visibleProperty().get());
 });
 searchToolbar.getChildren().addAll(NodeHelper.horizontalSpacer(), customTextField, searchIconRight, NodeHelper.horizontalSpacer());
 searchToolbar.setVisible(false);
}

代码示例来源:origin: org.controlsfx/controlsfx

closeBtn.setMinSize(17, 17);
closeBtn.setPrefSize(17, 17);
closeBtn.setFocusTraversable(false);
closeBtn.opacityProperty().bind(transition);
GridPane.setMargin(closeBtn, new Insets(0, 0, 0, 8));

相关文章