ServerCraft/app/src/main/kotlin/xyz/brysonsteck/serverfordummies/App.kt

35 lines
846 B
Kotlin
Raw Normal View History

/*
* 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) {
2023-05-09 21:59:26 -06:00
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()
}
2023-05-09 16:31:47 -06:00
public fun loadFXML(fxml: String) : Parent {
val fxmlLoader = FXMLLoader(this.javaClass.getResource(fxml + ".fxml"))
return fxmlLoader.load()
}
public fun run() {
launch()
}
}