<p>I'm working on a System Preferences Pane. It opens fine on some computers, but on other Macs (all running 10.5.5), the preference pane refuses to load and simply hangs, spitting the following into the console:</p>

<pre><code>11/9/08 8:38:50 PM [0x0-0x31031].com.apple.systempreferences[369] Sun Nov 9 20:38:50 Macintosh.local System Preferences[369] &lt;Error&gt;: Failed to create window context device 
11/9/08 8:38:50 PM [0x0-0x31031].com.apple.systempreferences[369] Sun Nov 9 20:38:50 Macintosh.local System Preferences[369] &lt;Error&gt;: CGWindowContextCreate: failed to create context delegate.
11/9/08 8:38:55 PM [0x0-0x31031].com.apple.systempreferences[369] Sun Nov 9 20:38:55 Macintosh.local System Preferences[369] &lt;Error&gt;: Failed to create window context device
</code></pre>

<p>Any ideas why this is happening?</p>

<p>Thanks.</p>

You should read up on Reflection in Java.
The following example would invoke the method
myObjectThatContainsMethod#methodNameAsString(Integer arg1, Integer arg2)
```
```
Integer[] params = {new Integer(123),new Integer(567)}; 
Class cl=Class.forName("stringParsedFromYourXML"); 
Class[] par=new Class[2]; 
par[0]=Integer.TYPE; 
par[1]=Integer.TYPE; 
Method mthd=cl.getMethod("methodNameAsString", parameterTypes); 
mthd.invoke(new myObjectThatContainsMethod(), params);
```
```
hope that helps..