This commit is contained in:
2025-07-26 20:59:15 +08:00
parent 76b4c65369
commit 9b6627566d
4 changed files with 26 additions and 1 deletions
+15
View File
@@ -13,13 +13,28 @@
* ...
*/
package com.msksbr.jfxLearn.lesson1
import javafx.application.Application
import javafx.scene.Scene
import javafx.stage.Stage
import javafx.scene.control.Label
import javafx.scene.layout.BorderPane
// 1. create a class that extends javafx.application.application
class MainApplication : Application() {
// 2. override Application.start
override fun start(stage: Stage) {
// Node
val label = Label("i am label")
// Parent
val pane = BorderPane(label)
// Scene
val scene = Scene(pane, 300.0, 300.0)
// 3. bind Scene to Stage
stage.scene = scene
stage.title = "i am Stage"
stage.show()
}