javafx.scene.layout.BorderPane.setTop()方法的使用及代码示例

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

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

BorderPane.setTop介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public class ContactApp extends Application {

  @Override
  public void start(Stage primaryStage) throws Exception {

    BorderPane root = new BorderPane();
    FXMLLoader listLoader = new FXMLLoader(getClass().getResource("list.fxml"));
    root.setCenter(listLoader.load());
    ListController listController = listLoader.getController();

    FXMLLoader editorLoader = new FXMLLoader(getClass().getResource("editor.fxml"));
    root.setRight(editorLoader.load());
    EditorController editorController = editorLoader.getController();

    FXMLLoader menuLoader = new FXMLLoader(getClass().getResource("menu.fxml"));
    root.setTop(menuLoader.load());
    MenuController menuController = menuLoader.getController();

    DataModel model = new DataModel();
    listController.initModel(model);
    editorController.initModel(model);
    menuController.initModel(model);

    Scene scene = new Scene(root, 800, 600);
    primaryStage.setScene(scene);
    primaryStage.show();
  }
}

代码示例来源:origin: stackoverflow.com

ctrls.addRow(1,  contentDisplayBox, alignmentBox, textAlignmentBox);
root.setTop(ctrls);

代码示例来源:origin: stackoverflow.com

public class GameController {

  @FXML
  private BorderPane rootPane ;

  // ...

  public void showMenu(Node menu) {
    rootPane.setTop(menu);
  }

  // ...
}

代码示例来源:origin: torakiki/pdfsam

@Inject
public OpenWithDialog(StylesConfig styles, List<Module> modules) {
  initModality(Modality.WINDOW_MODAL);
  initStyle(StageStyle.UTILITY);
  setResizable(false);
  setTitle(DefaultI18nContext.getInstance().i18n("Open with"));
  this.modules = modules.stream().sorted(comparing(m -> m.descriptor().getName())).collect(toList());
  messageTitle.getStyleClass().add("-pdfsam-open-with-dialog-title");
  BorderPane containerPane = new BorderPane();
  containerPane.getStyleClass().addAll(Style.CONTAINER.css());
  containerPane.getStyleClass().addAll("-pdfsam-open-with-dialog", "-pdfsam-open-with-container");
  containerPane.setTop(messageTitle);
  BorderPane.setAlignment(messageTitle, Pos.TOP_CENTER);
  filesList.setPrefHeight(150);
  containerPane.setCenter(filesList);
  buttons.getStyleClass().addAll(Style.CONTAINER.css());
  containerPane.setBottom(buttons);
  BorderPane.setAlignment(buttons, Pos.CENTER);
  Scene scene = new Scene(containerPane);
  scene.getStylesheets().addAll(styles.styles());
  scene.setOnKeyReleased(new HideOnEscapeHandler(this));
  setScene(scene);
  eventStudio().addAnnotatedListeners(this);
}

代码示例来源:origin: stackoverflow.com

pane.setTop(hBox);
pane.setCenter(table);
stage.setScene(new Scene(pane, 640, 480));

代码示例来源:origin: stackoverflow.com

BorderPane border = new BorderPane();
Label toppanetext = new Label("Page Title");
border.setTop(toppanetext);
Label centerpanetext = new Label ("Some data here");
border.setCenter(centerpanetext);

代码示例来源:origin: stackoverflow.com

MenuBar menuBar = new MenuBar ();
final String os = System.getProperty ("os.name");
if (os != null && os.startsWith ("Mac"))
 menuBar.useSystemMenuBarProperty ().set (true);

BorderPane borderPane = new BorderPane ();
borderPane.setTop (menuBar);

primaryStage.setScene (new Scene (borderPane));

代码示例来源:origin: stackoverflow.com

MenuBar menuBar = new MenuBar ();
 if( System.getProperty("os.name","UNKNOWN").equals("Mac OS X")) {
 menuBar.setUseSystemMenuBar(true);
}

BorderPane borderPane = new BorderPane ();
borderPane.setTop (menuBar);
primaryStage.setScene (new Scene (borderPane));

代码示例来源:origin: stackoverflow.com

@Override
public void start(Stage primaryStage) {
  SplitPane splitPane = new SplitPane(new TableView(),
                    new VBox(new Label("some other content")));

  splitPane.setOrientation(Orientation.HORIZONTAL);

  // place splitPane as center
  BorderPane borderPane = new BorderPane(splitPane);

  borderPane.setTop(new MenuBar(new Menu("File")));

  Scene scene = new Scene(borderPane, 600, 400);

  primaryStage.setScene(scene);
  primaryStage.show();
}

代码示例来源:origin: stackoverflow.com

BorderPane borderPane = new BorderPane();
borderPane.setTop(menuBar);
borderPane.setCenter(splitPane);

代码示例来源:origin: stackoverflow.com

BorderPane root = new BorderPane();

Label centeredText = new Label("I want this text centered!");
Button unorganizedButton = new Button("Press me");

BorderPane.setAlignment(centeredText, Pos.CENTER);

root.setTop(centeredText);
root.setBottom(unorganizedButton);

代码示例来源:origin: stackoverflow.com

ScrollPane scrollPane = new ScrollPane(content);
  scrollPane.setFitToWidth(true);
//    scrollPane.prefHeightProperty().bind(top.heightProperty());

  BorderPane root = new BorderPane(scrollPane);
  root.setTop(new MenuBar(new Menu("Foo")));

  Scene scene = new Scene(root);

  aStage.setScene(scene);

  root.applyCss();
  scrollPane.setPrefHeight(top.prefHeight(-1));
  root.requestLayout();

  aStage.sizeToScene();
  aStage.show();
  aStage.toFront();

代码示例来源:origin: com.vektorsoft.demux.desktop/demux-jfx-core

@Override
  public void run() {
    primary.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("img/main/dmx-icon-16x16.png")));
    primary.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("img/main/dmx-icon-32x32.png")));
    primary.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("img/main/dmx-icon-64x64.png")));
    // make containers for menu and toolbars
    VBox topContainer = new VBox();
    topContainer.getChildren().addAll(menuBar, toolbarContainer);
    BorderPane bp = (BorderPane) primary.getScene().getRoot();
    bp.setTop(topContainer);
  }
});

代码示例来源:origin: stackoverflow.com

@Override
public void start(Stage primaryStage) {

  HBox hbox = new HBox();

  Button b = new Button("add");
  b.setOnAction(ev -> hbox.getChildren().add(new Label("Test")));

  ScrollPane scrollPane = new ScrollPane(hbox);
  scrollPane.setFitToHeight(true);

  BorderPane root = new BorderPane(scrollPane);
  root.setPadding(new Insets(15));
  root.setTop(b);

  Scene scene = new Scene(root, 400, 400);
  primaryStage.setScene(scene);
  primaryStage.show();
}

代码示例来源:origin: stackoverflow.com

HBox hBox = new HBox();
BorderPane mainPane = new BorderPane();
mainPane.setTop(hBox);
hBox.getChildren().addAll(new TextField(), new Label("hi", ...);

代码示例来源:origin: stackoverflow.com

BorderPane root = new BorderPane();

MineSweeperField field = new MineSweeperField();
MineSweepButton msButton = new MineSweepButton(field);
msButton.setText("5");

Button reveal = new Button("Reveal");
Button unreveal = new Button("Unreveal");
Button flag = new Button("Flag");

root.setTop(new VBox(msButton, new HBox(reveal, unreveal, flag)));
reveal.setOnAction(e -> field.setState(State.REVEALED));
unreveal.setOnAction(e -> field.setState(State.UNREVEALED));
flag.setOnAction(e -> field.setState(State.FLAGGED));

代码示例来源:origin: stackoverflow.com

public void start(Stage primaryStage) {

  ComboBox<String> combobox1 = new ComboBox<>();

  ComboBox<String> combobox2 = new ComboBox<>();
  combobox2.setDisable(true);
  combobox2.setStyle("-fx-opacity: 1;");

  BorderPane root = new BorderPane();
  root.setPadding(new Insets(15));

  root.setTop(combobox1);
  root.setBottom(combobox2);
  Scene scene = new Scene(root, 400, 400);
  primaryStage.setScene(scene);
  primaryStage.show();
}

代码示例来源:origin: PhoenicisOrg/phoenicis

/**
 * {@inheritDoc}
 */
@Override
public void initialise() {
  final BorderPane container = new BorderPane();
  container.getStyleClass().add("detailsPane");
  container.setTop(createHeader());
  container.setCenter(createContent());
  getChildren().addAll(container);
}

代码示例来源:origin: org.jrebirth.af/component

void reloadButtonBar() {
  node().setTop(null);
  node().setBottom(null);
  node().setLeft(null);
  node().setRight(null);
  initButtonBar();
}

代码示例来源:origin: org.jrebirth.af.showcase/todos

/**
 * {@inheritDoc}
 */
@Override
protected void initView() {
  super.initView();
  final ImageView appName = new ImageView(TodosImages.HEADER_LOGO.get());
  node().setTop(appName);
  this.borderPane = new BorderPane();
  node().setCenter(this.borderPane);
  this.borderPane.setTop(model().headerModel().node());
  this.borderPane.setCenter(model().contentModel().node());
  this.borderPane.setBottom(model().statusModel().node());
}

相关文章