JMenuItem gets non wanted UI

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

JMenuItem gets non wanted UI

Postby lvr » Tue Feb 02, 2010 4:46 pm

Hello,
I have a couple of JMenuItem who get a "com.jidesoft.plaf.vsnet.VnbetMenuItemUI" that I haven't requested.

All my application is under the WindowsXP L&F with no exception. I haven't set any UI. So all my components should use their default WindowsUI.

But for these menu (and also my status bar made of JLabel) gets some weird UI. Like some interference of board effect.

Is this a known problem ? And how can I solve this ?

Thanks,
lvr
 
Posts: 8
Joined: Tue Feb 02, 2010 4:38 pm

Re: JMenuItem gets non wanted UI

Postby JIDE Support » Tue Feb 02, 2010 5:03 pm

Did you by any chance use any JIDE components in your application? If so, LookAndFeelFactory#installJideExtension() will be invoked automatically to install those UIs. To disable the unexpected UI, please try to use the following code.
Code: Select all
            UIManager.getDefaults().put("MenuItemUI", "com.sun.java.swing.plaf.windows.WindowsMenuItemUI");

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JMenuItem gets non wanted UI

Postby lvr » Wed Feb 03, 2010 2:20 am

JIDE Support wrote:Did you by any chance use any JIDE components in your application?
Well yes. They're so great :wink:
JIDE Support wrote: If so, LookAndFeelFactory#installJideExtension() will be invoked automatically to install those UIs. To disable the unexpected UI, please try to use the following code.
Code: Select all
            UIManager.getDefaults().put("MenuItemUI", "com.sun.java.swing.plaf.windows.WindowsMenuItemUI");
I see 2 limits for this. First) My application actually runs with the OS default L&F. Thus forcing it to WindowsMenuItemUI will look strange for someone using it on Mac or Linux.
Second) How can I identify the components affected by this ? Visually ? Is there a sequency reason ?
I ask this because some other JMenuItem are not affected by this.

Would it not be simpler that LookAndFeelFactory#installJideExtension() doesn't modifiy the UI from non-Jide components ?

Regards,
lvr
 
Posts: 8
Joined: Tue Feb 02, 2010 4:38 pm

Re: JMenuItem gets non wanted UI

Postby JIDE Support » Wed Feb 03, 2010 12:32 pm

Thanks for using JIDE components. Yes, there is a sequence issue. Some components created before JIDE components will still use the original UIDefaults. To avoid the inconsistency, you could invoke LookAndFeelFactory#installJideExtension() at the very beginning.

The reason L&F was changed is that, we have to modify some of the UIDefaults for JIDE components to use and make those components look consistent. I'm afraid we are not going to separate those UIDefaults by component. It will be too heavy workload and actually hard to maintain the accuracy later on.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JMenuItem gets non wanted UI

Postby lvr » Thu Feb 04, 2010 5:44 am

Ok I will see what I can do to avoid the UI from being modified.
Thanjks for the answer.
lvr
 
Posts: 8
Joined: Tue Feb 02, 2010 4:38 pm

Re: JMenuItem gets non wanted UI

Postby Walter Laan » Thu Feb 04, 2010 7:26 am

The LookAndFeelFactory#installJideExtension(XERTO/VSNET_WITHOUT_MENU) do not install the Jide menu UI classes and defaults so you should be able to use that before you use any Jide component.
Walter Laan
 
Posts: 383
Joined: Mon May 01, 2006 12:13 am

Re: JMenuItem gets non wanted UI

Postby lvr » Wed May 12, 2010 2:48 pm

I didn't saw your answer earlier. It works fine. I tested with some "exotic" L&F like Nimbus and all is correctly set. Thanks.
lvr
 
Posts: 8
Joined: Tue Feb 02, 2010 4:38 pm


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 53 guests