Last active
April 6, 2022 18:04
-
-
Save robbieh/c4662690abff19fc1cca12decd9b486e to your computer and use it in GitHub Desktop.
This file contains 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 characters
(def f (new Frame "AWT test")) | |
(. f setSize 400 400) | |
(. f setLayout (new GridLayout 3 1)) | |
(class f) ;;java.awt.Frame | |
(supers (class f));; #{java.awt.Container java.io.Serializable java.awt.Window java.awt.image.ImageObserver java.awt.Component java.awt.MenuContainer java.lang.Object javax.accessibility.Accessible} | |
(r/reflect (.getAccessibleContext f) ) | |
(def acc (AWTAccessor/getComponentAccessor)) | |
(.getBounds acc f);; #object[java.awt.Rectangle 0x40af415a "java.awt.Rectangle[x=1280,y=0,width=400,height=400]"] | |
(def peer (.getPeer acc f) ) | |
(class peer);; sun.awt.X11.XFramePeer | |
(def pc (.getClass peer)) | |
(def gsm (.getMethod pc "getShell" nil) );; #object[java.lang.reflect.Method 0x45a836a "public long sun.awt.X11.XDecoratedPeer.getShell()"] | |
(.invoke gsm peer) | |
;;Execution error (IllegalArgumentException) at jnatest.core/eval9293 (form-init8734797063564353548.clj:157). | |
;;No matching method invoke found taking 1 args for class java.lang.reflect.Method | |
;;Clojure: class java.lang.IllegalArgumentException | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment