This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Here is my attempt at converting http://docs.oracle.com/javafx/2/get_started/hello_world.htm to Kawa. It compiles fine, but when run, I get this exception: java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403) at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47) at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.AbstractMethodError: javafx.application.Application.start(Ljavafx/stage/Stage;)V at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319) at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206) at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29) at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73) ... 1 more It seems my implementation of method `start` is not pick-up correctly. Not sure what I did wrong though. Regards, Matt On Wed, Nov 6, 2013 at 2:21 PM, Per Bothner <per@bothner.com> wrote: > On 11/06/2013 10:35 AM, Tony West wrote: >> >> Hi. >> >> I can't work out how to write a JavaFX program in Kawa. >> >> I would like to write it without using any of the special >> functions/macros Per has defined but rather just translate it as >> directly as possible from a Java version. >> >> Can anyone provide me with an example of how to do this? eg just a simple >> JavaFX hello world? > > > I'd start with a Java program that did what I wanted, and then convert > each class to a define-simple-class. > > A variation is to pick the "main class" - perhaps whatever class extends > Application. Then make that be the "module class". I.e. the methods > in that class become the top-level functions; you add a (module-extends > XXX); > and so on. See http://www.gnu.org/software/kawa/Module-classes.html > This is essentially what the javafx-application - it expands to (among > other stuff) (module-extends KawaJavafxApplication), but instead you can > do: > (module-extends javafx.application.Application) > and then define: > (define (start (stage ::javafx.stage.Stage))::void > ... actions ...) > > It's been a while since I looked closely s this - have you run into > problems trying this? > -- > --Per Bothner > per@bothner.com http://per.bothner.com/
Attachment:
hello-world.scm
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |