aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/xyz/brysonsteck/serverfordummies/App.kt
blob: 0a3cab9d28ce3bf4b3de08b3adf79e3251c9c7e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * This Kotlin source file was generated by the Gradle 'init' task.
 */
package xyz.brysonsteck.serverfordummies

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image
import javafx.stage.Stage;
import java.awt.Desktop;

class App : Application() {

  override fun start(stage: Stage) { 
    var scene = Scene(loadFXML("primary"), 963.0, 713.0)
    stage.icons.add(Image(this.javaClass.getResourceAsStream("app-256x256.png")))
    stage.setResizable(false)
    stage.title = "Server For Dummies"
    stage.scene = scene
    stage.show()
  }

  public fun loadFXML(fxml: String) : Parent {
    val fxmlLoader = FXMLLoader(this.javaClass.getResource(fxml + ".fxml"))
    return fxmlLoader.load()
  }

  public fun run() {
    launch()
  }

}