Developing Basic GUI for micro manager

I am currently trying to develop a basic GUI for micromanager. At first I tried to use the EMU plugin, but whenever I try to launch EMU with my GUI it crashes. Now I am trying to create a plugin where my GUI can be accessed, yet when trying to learn how to develop plugins from the example code given from micromanager this error constantly appears. Any help would be greatly appreciated.

Jun 09, 2021 2:28:36 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0xffffffff80000002. Windows RegCreateKeyEx(...) returned error code 5.
Jun 09, 2021 2:28:36 PM java.util.prefs.WindowsPreferences WindowsRegOpenKey1
WARNING: Trying to recreate Windows registry node Software\JavaSoft\Prefs at root 0xffffffff80000002.
Jun 09, 2021 2:28:36 PM java.util.prefs.WindowsPreferences openKey
WARNING: Could not open windows registry node Software\JavaSoft\Prefs at root 0xffffffff80000002. Windows RegOpenKey(...) returned error code 2.
2021-06-09T14:28:36.829400 tid18760 [IFO,App] Finished waiting for plugins to load
2021-06-09T14:28:43.473807 tid18760 [IFO,App] 
                                    [       ] java.lang.IllegalAccessException: class org.micromanager.internal.utils.GUIUtils cannot access class sun.awt.Win32GraphicsEnvironment (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @255b53dc in Thread[AWT-EventQueue-0,6,main]
                                    [       ]   at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(
                                    [       ]   at java.base/java.lang.reflect.AccessibleObject.checkAccess(
                                    [       ]   at java.base/java.lang.reflect.Method.invoke(
                                    [       ]   at org.micromanager.internal.utils.GUIUtils.preventDisplayAdapterChangeExceptions(
                                    [       ]   at org.micromanager.internal.MMStudio.loadSystemConfiguration(
                                    [       ]   at org.micromanager.internal.MMStudio.<init>(
                                    [       ]   at MMStudioPlugin$
                                    [       ]   at java.desktop/java.awt.event.InvocationEvent.dispatch$$$capture(
                                    [       ]   at java.desktop/java.awt.event.InvocationEvent.dispatch(
                                    [       ]   at java.desktop/java.awt.EventQueue.dispatchEventImpl(
                                    [       ]   at java.desktop/java.awt.EventQueue$
                                    [       ]   at java.desktop/java.awt.EventQueue$
                                    [       ]   at java.base/
                                    [       ]   at java.base/$JavaSecurityAccessImpl.doIntersectionPrivilege(
                                    [       ]   at java.desktop/java.awt.EventQueue.dispatchEvent(
                                    [       ]   at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(
                                    [       ]   at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(
                                    [       ]   at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(
                                    [       ]   at java.desktop/java.awt.EventDispatchThread.pumpEvents(
                                    [       ]   at java.desktop/java.awt.EventDispatchThread.pumpEvents(
                                    [       ]   at java.desktop/

Micromanager Plugin Tutorial I am following:

The Example Code I am trying to use:

What JDK are you using? If anything other than 8, try JDK8.

It looks like you’re trying to use AWT instead of Swing, and MicroManager seems (I’m a relative noob on the GUI front) to be based around Swing.

If you need regular widgets, Swing’s got them. If you need custom drawing stuff, this SE thread is worth a look.

Thank you, it seems as if JDK 16 no longer supported that class but JDK 8 does.

Based on some quick searches, it looks like our code should not be using that class (it is an internal class not for outside use), but there are likely multiple issues in the code base like that. We develop using JDK8, and advise everyone else working with MM code to do the same. You may (or may not) encounter issues with newer JDKs.

If you ever want to adapt your plugin to using EMU again and encounter trouble, let me know. I’m interested in seeing possible applications, which we may integrate as default plugins !