Hello,

when in swixml descriptor menubar has different parent then jframe, it
won't show up.
after looking into source code I found where the problem was. It's in
the Parser.addChild method.
This could be a fix:

***************
*** 784,794 ****
      if (component instanceof JMenuBar) {
        try {
          Method m = parent.getClass().getMethod( "setJMenuBar", new
Class[]{JMenuBar.class} );
!         if (m != null) {
!           m.invoke( parent, new Object[]{component} );
!         } else {
!           parent.add(component);
!         }
        } catch (Exception e) {
          // intentionally empty
        }
--- 784,792 ----
      if (component instanceof JMenuBar) {
        try {
          Method m = parent.getClass().getMethod( "setJMenuBar", new
Class[]{JMenuBar.class} );
!         m.invoke( parent, new Object[]{component} );
!       } catch (NoSuchMethodException e) {
!               parent.add(component);
        } catch (Exception e) {
          // intentionally empty
        }

Cheers,
Vitali

Reply via email to