protected void initMenus() { JMenubar mbar = getMenuBar(); JMenu menu = new JMenu("Analyze"); mbar.add(analyze); addToStaticMenu("analyze", menu); }And we have an
ImagePlugin
which has an action allowing to analyse an image:public class ImagePlugin extends AbstractSwingMDIPlugin { private AbstractAction analyzeImageAction = ... public Object getStaticMenuElements(String menu) { if (menu.equals("analyze")) { return analyzeImageAction; } else { return null; } } }The action will be added to the "Analyze" menu.
protected void initMenus() { JMenubar mbar = getMenuBar(); JMenu menu = new JMenu("Analyze"); mbar.add(analyze); bookmarkMenu("analyze", menu); }And we have an
ImagePlugin
which has an action allowing to analyse an image:public class ImagePlugin extends AbstractSwingMDIPlugin { private AbstractAction analyzeImageAction = ... public void register(MDIApplication app) throws Exception { super.register(app); MDIMenuFactory factory = ((GUIApplication)app).getMenuFactory(); factory.addToBookmarkedMenu("Analyze", analyzeImageAction); } }The action will be added to the "Analyze" menu.
Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences