我正在使用NetBeans IDE 8.2 for JavaFX.我已经知道,为了改变按钮的位置,我需要使用setLayoutX/Y. 我试过这个,对按钮没有任何影响.这是我的代码:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javafxapplication2;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
*
* @author coolDawg1234
*/
public class JavaFXApplication2 extends Application {
@Override
public void start(Stage primaryStage) {
String x = "1";
String y = "0"; …Run Code Online (Sandbox Code Playgroud)