5

Every time I install Netbeans on Ubuntu, I have to edit the ./etc/netbeans.conf file to include an option specifying the look and feel; otherwise, the menus are all black on dark gray, which is impossible to use.

Is there a way to specify a global look and feel for swing apps, so that this isn't such a pain? Here is the line I have to change:

46: netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true"

becomes:

46: netbeans_default_options="--laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel -J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true"
Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
Bryan Agee
  • 3,356
  • 4
  • 24
  • 28

1 Answers1

2

The menus are dark and gray because of a Java bug. You can find it on Ubuntu's bug tracker. In the meantime, if you want to integrate Netbeans in the global menu, there's a way to do that. Here's how it looks like: http://www.youtube.com/watch?v=E8d9szgPhs8

The steps, obtained from this blog post are as follows.

  1. First install openjdk-7-jdk. It's required, so if you use 6, be careful.
  2. To make Netbeans use openjdk-7-jdk, launch Netbeans with

    /opt/netbeans-7.1.2/bin/netbeans --jdkhome /usr/lib/jvm/java-7-openjdk-i386

    You can make a .desktop file in ~/.local/share/applications with that as the exec command, for conveience. Copy the default one and edit it.

  3. Install and use the Java Swing Ayatana plugin from this googlecode page.
  4. Restart Netbeans.
MarkovCh1
  • 2,093
  • 2
  • 24
  • 29
  • 1
    Also, the jdk you use in the Exec might be different for you, because I use the 32 bit version. – MarkovCh1 Jul 11 '12 at 21:42
  • Sweet-- it not easier, but probably worth the effort. It's always annoyed me how java apps don't work with the global menu. – Bryan Agee Jul 11 '12 at 22:26