carlw
05/10/2018, 4:47 PMbjonnh
05/10/2018, 4:49 PMSackCastellon
05/10/2018, 8:56 PMjava.time.LocalDate
and Exposed to store the date in a database, but currently it only supports org.joda.time.DateTime
SackCastellon
05/10/2018, 9:25 PMfun java.time.LocalDateTime.toJoda(): org.joda.time.DateTime = DateTime(this.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli())
fun org.joda.time.DateTime.toJava(): java.time.LocalDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(this.millis), ZoneId.systemDefault())
Any comments?carlw
05/10/2018, 9:42 PMCarlton Whitehead
05/10/2018, 9:49 PMCarlton Whitehead
05/10/2018, 10:11 PMdate-split-modules
branchJon White
05/11/2018, 2:49 AM../build/fxlauncher
and running java -jar fxlauncher.jar
. All the requisite files are present. But the executable will not run.Jon White
05/11/2018, 2:50 AMgenerateNativeInstaller
, via Gradle, and is found within ../build/installer/bundles/
.Jon White
05/11/2018, 2:51 AMJon White
05/11/2018, 3:49 AMJon White
05/11/2018, 3:52 AMapp
directory. The issue is completely solved as of now, but I will leave this in case it helps someone searching for FXLauncher details.kastork
05/11/2018, 1:35 PMfile://
url instead of http://
?John
05/11/2018, 7:13 PMwebview
builder within one of my views. I've gotten it working just fine in a different app that's plain Java/JavaFX, but for some reason I'm getting NPE with TornadoFX. I have a simple HTML file, that does nothing but load a stylesheet and three scripts in the body to display a full-screen animated background slideshow. My intention is to create a create a StackPane and then layer another Layout on top of it with a welcome message and sign in/out buttons. However, I cannot seem to get the webview
to load the HTML. Here's what I've got so far:
class MainView : View("Hello TornadoFX") {
override val root = stackpane {
webview {
val bg: String = MainView::class.java.getResource("bg.html").toExternalForm()
engine.load(bg)
}
}
}
John
05/11/2018, 7:14 PMJohn
05/11/2018, 7:15 PMengine.load(resources["bg.html"])
, engine.load(resources["./bg.html"])
, and a few other things. I can't seem to figure out why I'm getting the NPEedvin
05/11/2018, 7:39 PMgtnarg
05/11/2018, 8:04 PMedvin
05/11/2018, 9:56 PMJohn
05/12/2018, 7:45 AMJohn
05/12/2018, 7:46 AMJohn
05/12/2018, 8:26 AMJohn
05/12/2018, 10:00 AMMay 12, 2018 4:29:21 AM tornadofx.DefaultErrorHandler uncaughtException
SEVERE: Uncaught error
java.lang.NullPointerException
at edu.rochester.dcops.view.MainView$root$1$1.invoke(MainView.kt:8)
at edu.rochester.dcops.view.MainView$root$1$1.invoke(MainView.kt:5)
at tornadofx.FXKt.opcr(FX.kt:449)
at tornadofx.ControlsKt.webview(Controls.kt:31)
at edu.rochester.dcops.view.MainView$root$1.invoke(MainView.kt:7)
at edu.rochester.dcops.view.MainView$root$1.invoke(MainView.kt:5)
at tornadofx.FXKt.opcr(FX.kt:449)
at tornadofx.LayoutsKt.stackpane(Layouts.kt:120)
at tornadofx.LayoutsKt.stackpane$default(Layouts.kt:120)
at edu.rochester.dcops.view.MainView.<init>(MainView.kt:6)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at tornadofx.FXKt.find(FX.kt:408)
at tornadofx.FXKt.find$default(FX.kt:393)
at tornadofx.App.start(App.kt:86)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
John
05/12/2018, 10:01 AMproj_structure.PNG▾
John
05/12/2018, 10:02 AMresources
folder, which is marked in IntelliJ as a resource root. I've also tried placing them adjacent to the MainView.kt
file, with similar resultscarlw
05/12/2018, 11:44 AMcarlw
05/12/2018, 12:21 PMcarlw
05/12/2018, 12:21 PMJohn
05/12/2018, 12:49 PMjavaClass.getResource("/bg.html").toExternalForm()
within the engine.load()
call, but it was also throwing the NPE. Could it have to do with the read-only variable assignment forcing a resolution to the resource first before passing it to the engine.load()
method?John
05/12/2018, 12:50 PM