daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest May 16th, 2018 116 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. open CadmiumObj
  2. open Swing
  3.  
  4. let () =
  5.   let frame = new jFrame (`String "My Frame") in
  6.   let button = new jButton (`String "Press Me!") in
  7.   button#addActionListener (new jActionListener (`Cd'wrap (object
  8.       method actionPerformed (_ : jObject) =
  9.         button#setText "Hello OCaml!"
  10.   end)));
  11.   ignore (frame#add (button :> jObject));
  12.   frame#setLayout (new jGridLayout (`IntIntIntInt (2l, 2l, 3l, 3l)) :> jObject);
  13.   frame#setSize 300l 80l;
  14.   frame#setVisible true
RAW Paste Data
Top