Skip to content

Instantly share code, notes, and snippets.

@3gcodes
Created October 18, 2017 21:18
Show Gist options
  • Select an option

  • Save 3gcodes/3d8eb60b049e5cef45277f1fc9e8d3b7 to your computer and use it in GitHub Desktop.

Select an option

Save 3gcodes/3d8eb60b049e5cef45277f1fc9e8d3b7 to your computer and use it in GitHub Desktop.
@SpringBootApplication
open class MyApp : App(MyView::class, Styles::class) {
private lateinit var context : ConfigurableApplicationContext
override fun init() {
super.init()
context = SpringApplication.run(this.javaClass)
context.autowireCapableBeanFactory.autowireBean(this)
FX.dicontainer = object : DIContainer {
override fun <T : Any> getInstance(type: KClass<T>): T = context.getBean(type.java)
}
}
override fun stop() {
super.stop()
context.close()
}
companion object {
@JvmStatic
fun main(args: Array<String>) {
Application.launch(MyApp::class.java, *args)
}
}
class Styles : Stylesheet()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment