Created
April 7, 2014 02:48
-
-
Save mmhelloworld/10014175 to your computer and use it in GitHub Desktop.
Revisions
-
mmhelloworld created this gist
Apr 7, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ package fregeappletsupport; import javax.swing.JApplet; import javax.swing.SwingUtilities; import fregeapplet.HelloApplet; /** * A starter class since Frege cannot extend a Java class * */ public class AppletSupport extends JApplet { @Override public void init() { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { // This calls frege function HelloApplet.appletInit(AppletSupport.this).apply(1).result().forced(); } }); } catch (final Exception e) { System.err.println("createGUI didn't complete successfully"); } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ module fregeapplet.HelloApplet where import Java.Swing data JApplet = native javax.swing.JApplet appletInit :: JApplet -> IO () appletInit applet = do hw <- JLabel.new "Hello World from frege!" applet.add hw return ()