import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class NewClass extends Application {
@Override
public void start(Stage s) {
GridPane grid = new GridPane(); //Grid排版
grid.setAlignment(Pos.CENTER); // 置中
grid.setHgap(10); //水平距離
grid.setVgap(10); //垂直距離
grid.setPadding(new Insets(25, 25, 25, 25)); //填充邊界。上下左右 四個方向的距離
Text scenetitle = new Text("彥霖實驗筆記");
scenetitle.setFont(Font.font("微軟正黑體", FontWeight.NORMAL, 20));
grid.add(scenetitle, 0, 0, 2, 1);
Scene scene = new Scene(grid, 300, 200); // Root
s.setScene(scene);
s.show();
}
public static void main(String[] args) {
launch(args);
}
}
留言列表