/*
 * Lesson: Basic Structure of JavaFX Applications
 *
 * Application
 *   Stage: aka. the window
 *     Scene: A Stage can contain multiple Scenes, but only one can be displayed at a time
 *       Parent (e.g., Group, Pane)
 *         Node (e.g., Button, Label)
 *       Parent (e.g., VBox, HBox)
 *         Node (e.g., TextField)
 *         Node (e.g., CheckBox)
 *         ...
 *       ...
 */

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()
    }
}

fun main(args: Array<String>) {
    Application.launch(MainApplication::class.java, *args)
}