Nimbus L&F makes Menus look wrong

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.

Nimbus L&F makes Menus look wrong

Postby Ruben.Hesselbaek » Mon Mar 19, 2012 2:56 am

Using JDK 1.6.0_25 and the Nimbus L&F I am getting menus with no spacing, here is a small sample that will show the problem

Code: Select all
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;

import com.jidesoft.docking.DefaultDockableHolder;

public class LookAndFeelTest extends DefaultDockableHolder {
 
  public static void main(String[] args) {
    try {
      for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (UnsupportedLookAndFeelException e) {
      // handle exception
    } catch (ClassNotFoundException e) {
      // handle exception
    } catch (InstantiationException e) {
      // handle exception
    } catch (IllegalAccessException e) {
      // handle exception
    }
    new LookAndFeelTest();
  }

  public LookAndFeelTest() {
    super("Test");
    setSize(640, 480);
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(new JMenu("File"));
    menuBar.add(new JMenu("Help"));
    setJMenuBar(menuBar);
    menuBar.revalidate();
    menuBar.repaint();
    setVisible(true);
  }
}
Ruben.Hesselbaek
 
Posts: 2
Joined: Mon Mar 19, 2012 2:54 am

Re: Nimbus L&F makes Menus look wrong

Postby JIDE Support » Mon Mar 19, 2012 9:18 am

Please try to install JIDE extension without menu. The modified test case is posted below FYI.
Code: Select all
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;

import com.jidesoft.docking.DefaultDockableHolder;
import com.jidesoft.plaf.LookAndFeelFactory;

public class LookAndFeelTest extends DefaultDockableHolder {

  public static void main(String[] args) {
    try {
      for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (UnsupportedLookAndFeelException e) {
      // handle exception
    } catch (ClassNotFoundException e) {
      // handle exception
    } catch (InstantiationException e) {
      // handle exception
    } catch (IllegalAccessException e) {
      // handle exception
    }
      LookAndFeelFactory.installJideExtension(LookAndFeelFactory.EXTENSION_STYLE_VSNET_WITHOUT_MENU);
    new LookAndFeelTest();
  }

  public LookAndFeelTest() {
    super("Test");
    setSize(640, 480);
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(new JMenu("File"));
    menuBar.add(new JMenu("Help"));
    setJMenuBar(menuBar);
    menuBar.revalidate();
    menuBar.repaint();
    setVisible(true);
  }
}

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

Re: Nimbus L&F makes Menus look wrong

Postby Ruben.Hesselbaek » Tue Mar 20, 2012 1:07 am

Thanks, that worked wonders.
Ruben.Hesselbaek
 
Posts: 2
Joined: Mon Mar 19, 2012 2:54 am


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

Who is online

Users browsing this forum: Google [Bot] and 12 guests

cron