JMRI: Application StructureThe JmriDemo program is just an example, but it's meant to be a good one.
The source for the main class currently lives in apps/JmriDemo/JMRIdemo.java, which defines the main class as apps.JmriDemo.JMRIdemo.
The demo main just creates the menubar, and populates if with the desired menus and items. Each item as a "Action" class object associated with it, which does the necessary initialization when needed.
Because we expect to have different interfaces in the jmrix package, the JMRI tools don't directly create the interface objects they need. Rather, they ask for instances of interfaces. For interfaces in the jmri package, which might be implemented by lots of different layout types, jmri.InstanceManager satisfies these requests.
More information on how things (e.g. objects representing items on the layout) are named is available on a separate page.
See also the page on the JMRI library structure.