constraints attribute doesn't work for menubar
[email protected] Mon, 22 Aug 2005 16:05:11 +0200
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
Hello,
specifying constraints attribute for menubar tag doesn't have any affect.
here is the possible fix for the problem. Parser.addChild method
should be modified like this:
// Set a JMenuBar for JFrames, JDialogs, etc.
//
if (component instanceof JMenuBar) {
try {
Method m =3D parent.getClass().getMethod("setJMenuBar", new
Class[]{JMenuBar.class});
m.invoke(parent, new Object[]{component});
} catch (NoSuchMethodException e) {
! if (constrains =3D=3D null) {
! parent.add(component);
! }
! else {
! parent.add(component, constrains);
! }
} catch (Exception e) {
// intentionally empty
}
Regards,
Vitali