Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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"
share|improve this question
add comment

1 Answer

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.
share|improve this answer
1  
Also, the jdk you use in the Exec might be different for you, because I use the 32 bit version. –  Syzygy 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.