本文整理汇总了Java中javafx.scene.control.Button.setLayoutY方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setLayoutY方法的具体用法?Java Button.setLayoutY怎么用?Java Button.setLayoutY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Button
的用法示例。
在下文中一共展示了Button.setLayoutY方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSaveFlightButton
import javafx.scene.control.Button; //导入方法依赖的package包/类
private Button createSaveFlightButton(Stage stage){
Button btnSaveFlight = new Button();
btnSaveFlight.setLayoutX(10);
btnSaveFlight.setLayoutY(60);;
btnSaveFlight.setText("Save Flight");
btnSaveFlight.setOnAction(
new EventHandler<ActionEvent>() {
@Override
public void handle(final ActionEvent e) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Flight plan (xml)");
File file = fileChooser.showSaveDialog(stage);
if (file != null) {
System.out.println("Selected " + file);
try {
fzv.setPlanningMode(false);
new SaveXMLFlight(file.getAbsolutePath(),wayPoints);
} catch (IOException | FlightZoneException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}});
return btnSaveFlight;
}
示例2: createNewFlightButton
import javafx.scene.control.Button; //导入方法依赖的package包/类
private Button createNewFlightButton(Stage stage){
Button btnNewFlight = new Button();
btnNewFlight.setLayoutX(10);
btnNewFlight.setLayoutY(10);;
btnNewFlight.setText("Record New Flight");
btnNewFlight.setOnAction(
new EventHandler<ActionEvent>() {
@Override
public void handle(final ActionEvent e) {
fzv.setPlanningMode(true);
}});
return btnNewFlight;
}
示例3: createButton
import javafx.scene.control.Button; //导入方法依赖的package包/类
public Button createButton(String btnText, int width){
Button btn = new Button();
btn.setLayoutX(btnXPosition);
btn.setLayoutY(btnYPosition);
btn.setPrefWidth(width);
btn.setText(btnText);
btnXPosition = btnXPosition + width + 20;
return btn;
}
示例4: createButton
import javafx.scene.control.Button; //导入方法依赖的package包/类
private Button createButton(Pane root, ColorPicker colorPicker) {
Button okayButton = new Button(myResources.getString("OkayButton"));
okayButton.setLayoutX(200);
okayButton.setLayoutY(100);
okayButton.setId("btnLogin");
okayButton.setOnAction(e -> {
root.setBackground(new Background(new BackgroundFill(colorPicker.getValue(), CornerRadii.EMPTY, Insets.EMPTY)));
stage.close();
});
return okayButton;
}
示例5: createButton
import javafx.scene.control.Button; //导入方法依赖的package包/类
private Button createButton() {
Button starting = new Button("Start A Game of Random Level");
starting.setLayoutX(500);
starting.setLayoutY(600);
starting.setId("starting");
starting.setMinWidth(100);
starting.setMinHeight(100);
return starting;
}
示例6: buildMainMenu
import javafx.scene.control.Button; //导入方法依赖的package包/类
private void buildMainMenu(Group root, Scene scene, Dimension screenSize) {
// Main title
Label maintitle = new Label();
maintitle.setText("Chess Master");
maintitle.setFont(new Font("Arial", MAIN_TITLE_FONT_SIZE));
maintitle.setLayoutX(MAIN_TITLE_LEFT_PADDING);
maintitle.setLayoutY(MAIN_TITLE_TOP_PADDING);
root.getChildren().add(maintitle);
// Buttons
Group buttonsGroup = new Group();
// Start button.
Button choiceGameButton = new Button();
choiceGameButton.setLayoutX(screenSize.getWidth() * BUTTON_LEFT_PADDING);
choiceGameButton.setLayoutY(maintitle.getLayoutY() * 2);
choiceGameButton.setPrefSize(BUTTONS_WIDTH, BUTTONS_HEIGHT);
choiceGameButton.setText("Choose your game");
buttonsGroup.getChildren().add(choiceGameButton);
// Setting button.
Button settingButton = new Button();
settingButton.setLayoutX(screenSize.getWidth() * BUTTON_LEFT_PADDING);
settingButton.setLayoutY(choiceGameButton.getLayoutY() + BUTTONS_SPACE);
settingButton.setPrefSize(BUTTONS_WIDTH, BUTTONS_HEIGHT);
settingButton.setText("Settings");
buttonsGroup.getChildren().add(settingButton);
// Quit button.
Button quitButton = new Button();
quitButton.setLayoutX(screenSize.getWidth() * BUTTON_LEFT_PADDING);
quitButton.setLayoutY(settingButton.getLayoutY() + BUTTONS_SPACE);
quitButton.setPrefSize(BUTTONS_WIDTH, BUTTONS_HEIGHT);
quitButton.setText("Quit game");
quitButton.setOnAction(handle -> closeApp());
buttonsGroup.getChildren().add(quitButton);
root.getChildren().add(buttonsGroup);
// Copyright
Label copyright = new Label();
copyright.setText("All rights reserved, Nicolas GILLE, 2017");
copyright.setFont(new Font("Arial", 12));
copyright.setLayoutX(COPYRIGHT_LEFT_PADDING);
copyright.setLayoutY(COPYRIGHT_TOP_PADDING);
root.getChildren().add(copyright);
}
示例7: setStopBtn
import javafx.scene.control.Button; //导入方法依赖的package包/类
public void setStopBtn() {
Button stopBtn = this.stopBtn;
stopBtn.setLayoutX(150);
stopBtn.setLayoutY(250);
this.getChildren().add(stopBtn);
}
示例8: setPlayBtn
import javafx.scene.control.Button; //导入方法依赖的package包/类
public void setPlayBtn() {
Button playBtn = this.playBtn;
playBtn.setLayoutX(250);
playBtn.setLayoutY(250);
this.getChildren().add(playBtn);
}
示例9: setBtn
import javafx.scene.control.Button; //导入方法依赖的package包/类
public void setBtn() {
Button btn = this.btn;
btn.setLayoutX(250);
btn.setLayoutY(10);
btn.setPrefHeight(20);
}