//Button (also
called Nodes) on Pane (also called Parent)
//Pane on
Scene
//Scene on
Stage
import
javafx.application.Application;
import
javafx.scene.Scene;
import
javafx.scene.control.*;
import
javafx.stage.Stage;
import javafx.scene.layout.StackPane;
public class
myJavaDIY extends Application {
@Override
public void start(Stage myStage){
myStage.setTitle("This is
Stage");
Button btnOK = new Button();
btnOK.setText("OK");
TextField nametxt = new TextField();
StackPane Pane = new
StackPane();
Pane.getChildren().add(btnOK);
Scene myScene = new Scene(Pane);
myStage.setScene(myScene);
myStage.show();
}
public static void main(String[] args) {
System.out.println("Hello
World!");
launch();
}
}
No comments:
Post a Comment