MyTetra Share
Делитесь знаниями!
Пример работы с программой
Время создания: 03.09.2017 09:42
Текстовые метки: pro
Раздел: Java - JavaFx - Библиотека javaFx - scene - layout - BorderPane
Запись: xintrea/mytetra_db_mcold/master/base/1504420939i88rr9dn27/text.html на raw.githubusercontent.com


/*

* 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 uilayout;


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.BorderPane;

import javafx.scene.layout.StackPane;

import javafx.scene.shape.Circle;

import javafx.stage.Stage;


/**

*

* @author mcold

*/

public class UILayout extends Application {

@Override

public void start(Stage primaryStage) {

Button btn = new Button();

btn.setText("Say 'Hello World'");

btn.setOnAction(new EventHandler<ActionEvent>() {

@Override

public void handle(ActionEvent event) {

System.out.println("Hello World!");

}

});

BorderPane root = new BorderPane();

Circle cir = new Circle(150, 125, 70);

//root.setCenter(cir);

root.setBottom(cir);

//root.getChildren().add(btn);

root.setTop(btn);

Scene scene = new Scene(root, 300, 250);

primaryStage.setTitle("Hello World!");

primaryStage.setScene(scene);

primaryStage.show();

}


/**

* @param args the command line arguments

*/

public static void main(String[] args) {

launch(args);

}

}


Прикрепленные файлы:
 
MyTetra Share v.0.59
Яндекс индекс цитирования