GUIKIT 程序包 教程

Resolving Arbitrary Objects

Even though the GUIKit widget expression was designed with user interface issues in mind, you can construct object trees unrelated to user interface widgets and still take advantage of scripting with Wolfram Language code and setting and getting state through the use of properties.

GUIResolve allows you to resolve definitions into their runtime Java objects, but not expose a GUIObject runtime system or hold on to internal context state. This is useful if the object definition simply resolves to a set of Java objects, which you can then use in other ways through standard J/Link calls.

Click for copyable input

Notice in this example, a simple Java collections object is the root object in the expression though Wolfram Language script code is involved in populating the container with data.

Click for copyable input

Once a JavaObject is resolved by the definition, you can continue to use J/Link calls on the object instance.

Click for copyable input
Click for copyable input