otakusenpai
10/12/2018, 10:45 AMimport tornadofx.*
import tornadofx.Stylesheet.Companion.button
import tornadofx.Stylesheet.Companion.label
class MyView: View() {
override val root = vbox {
button("Press me")
label("Waiting")
}
}
class MyApp: App(MyView::class)
fun main(args: Array<String>) {
launch<MyApp>(args)
}
otakusenpai
10/12/2018, 10:45 AMError:Kotlin: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class tornadofx.UIComponent, unresolved supertypes: javafx.event.EventTarget
class <http://tornadofx.App|tornadofx.App>, unresolved supertypes: javafx.application.Application
otakusenpai
10/12/2018, 10:46 AMError:(8, 25) Kotlin: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun EventTarget.vbox(spacing: Number? = ..., alignment: Pos? = ..., op: VBox.() -> Unit = ...): VBox defined in tornadofx
Error:(7, 15) Kotlin: Cannot access class 'javafx.scene.Node'. Check your module classpath for missing or conflicting dependencies
otakusenpai
10/12/2018, 10:46 AMError:(9, 9) Kotlin: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun EventTarget.button(text: ObservableValue<String>, graphic: Node? = ..., op: Button.() -> Unit = ...): Button defined in tornadofx
public fun EventTarget.button(text: String = ..., graphic: Node? = ..., op: Button.() -> Unit = ...): Button defined in tornadofx
public fun ButtonBar.button(text: ObservableValue<String>, type: ButtonBar.ButtonData? = ..., graphic: Node? = ..., op: Button.() -> Unit = ...): Button defined in tornadofx
public fun ButtonBar.button(text: String = ..., type: ButtonBar.ButtonData? = ..., graphic: Node? = ..., op: Button.() -> Unit = ...): Button defined in tornadofx
public fun ToolBar.button(text: ObservableValue<String>, graphic: Node? = ..., op: Button.() -> Unit = ...): Button defined in tornadofx
public fun ToolBar.button(text: String = ..., graphic: Node? = ..., op: Button.() -> Unit = ...): Button defined in tornadofx
otakusenpai
10/12/2018, 10:46 AMError:(10, 9) Kotlin: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline fun <reified T> EventTarget.label(observable: ObservableValue<???>, graphicProperty: ObjectProperty<Node>? = ..., converter: StringConverter<in ???>? = ..., noinline op: Label.() -> Unit = ...): Label defined in tornadofx
public fun EventTarget.label(text: String = ..., graphic: Node? = ..., op: Label.() -> Unit = ...): Label defined in tornadofx
Error:(18, 12) Kotlin: Type argument is not within its bounds: should be subtype of 'Application'
otakusenpai
10/12/2018, 10:47 AMotakusenpai
10/12/2018, 10:49 AMapply plugin: 'kotlin'
apply plugin: 'application'
buildscript {
ext.kotlin_version = '1.2.71'
ext.tornadoFx_version = '1.7.17'
ext.jarDir = rootProject.buildDir.path + '/libs'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "no.tornado:tornadofx:$tornadoFx_version"
}
group 'com.github.otakusenpai.dbmsLab'
version '1.0-SNAPSHOT'
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
task fatJar(type: Jar) {
archiveName = rootProject.name + "-" + version + ".jar"
manifest {
attributes 'Main-Class': 'com.github.otakusenpai.dbmsLab.MainKt'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task assembleJar(type: Copy) {
from fatJar
into jarDir
}
build.dependsOn assembleJar
abhinay
10/13/2018, 7:00 AM