Skip to content

Commit

Permalink
[MainApp.kt] Get resources properly (well, one at least).
Browse files Browse the repository at this point in the history
  • Loading branch information
James authored and James committed Apr 26, 2019
1 parent f8bbe22 commit 8e09e7c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/org/idiosapps/MainApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ import javafx.fxml.FXMLLoader
import javafx.scene.Scene
import javafx.scene.layout.VBox
import javafx.stage.Stage
import java.io.File
import java.io.FileInputStream


// https://github.com/openjfx/samples/blob/master/IDE/IntelliJ/Modular/Java/hellofx/src/org/openjfx/MainApp.java
class MainApp : Application() {
override fun start(stage: Stage) {

val fxmlInputStream = this::class.java.classLoader.getResourceAsStream("org.idiosapps/UI.fxml")
val loader = FXMLLoader()
val fxmlFile = File("./src/main/resources/org.idiosapps/UI.fxml")
val fxmlInputStream = FileInputStream(fxmlFile)
val rootLayout = loader.load(fxmlInputStream) as VBox
val scene = Scene(rootLayout)

Expand Down

0 comments on commit 8e09e7c

Please sign in to comment.