Guest User

Untitled

a guest
May 16th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment