本文整理匯總了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);
}