X

Geertjan's Blog

  • December 2, 2012

Dark NetBeans

Geertjan Wielenga
Product Manager

Let's make NetBeans IDE look like this. Not saying it's a nice color or anything, just that it's possible to do so:

I changed the coloring in the Java editor by going to Tools | Options, then chose "Fonts & Colors", then selected the "Norway Today" profile and changed the background setting to Dark Gray.

Next, I put this themes.xml file into the "config" folder of the NetBeans IDE user directory, which you can identify as such by going to Help | About in the IDE. Go to the exact location defined by "User directory" in Help | About, and then go to the "config" folder within that folder:

The "config" folder of the user directory is the readable/writable root of the NetBeans IDE virtual filesystem. If a themes.xml file is found there, it is used, as described here.

Then, in netbeans.conf file, which is not in the NetBeans user directory but in the NetBeans installation directory, within its "etc" folder, I added the following to "netbeans_default_options":

-J-Dnetbeans.useTheme=true --laf Metal

The first of these enables usage of the themes.xml file, i.e., it notifies NetBeans IDE at startup to load the themes.xml file and to apply the content to the relevant UI components, while the second is needed because most/all of the themes only work if you're using the Metal Look and Feel.

Note: I must add that in most cases, whatever it is you're trying to achieve via a themes.xml file can probably be achieved in a different, and better, way. The themes.xml mechanism has been there forever, but is not actively supported or tested, though it may work for the specific thing you're trying to do anyway. For example, if you're trying to change the background color of a TopComponent, use the paintComponent method of the TopComponent instead of using a themes.xml file.

Join the discussion

Comments ( 16 )
  • guest Sunday, December 2, 2012

    nice! Does it work for all other languages supported in Netbeans too? BTW, many developers love dark themes, it should be native to have at least one well working dark theme.


  • guest Sunday, December 2, 2012

    Hi Geertjan,

    you are still using 7.3beta1 instead of 7.3beta2?!

    Did you encounter any major issue that prevents you from switching?

    Greetings markiewb


  • guest Sunday, December 2, 2012

    I agree that the editor should take a darker colour by default. I've tried Sublimes Text 2, and it really felt good when when I used it.

    Ergonomically, dark backgrounds are best for text editors, in my opinion, because they leave the eye relaxed. We spend a lot of time in front of our computer screen, I think it's a bit unnatural for the eyes to stay focused on such brightness for long.

    If we can get something dark by default, and an option to switch to the current theme, it would be just great.


  • guest Sunday, December 2, 2012

    thankx


  • Geertjan Sunday, December 2, 2012

    "Norway Today", i.e., the color profile used in the screenshot in this blog entry, has been a standard part of NetBeans IDE since at least about 5 years, I think... And, yes, it applies to all editors for all languages in NetBeans IDE.

    I use both 7.3 Beta and 7.3 Beta 2, I switch between them a lot -- one of them, in my case, has the full IDE, while the other is Java SE only.


  • guest Monday, December 3, 2012

    @Geertjan

    take a look at PHP Editor with "Norway Today" it is unusable :)

    method names black, not readable, varnames to dark again not readable.

    so no, it doesn't apply to all editors in NB


  • Simon Monday, December 3, 2012

    Hello Geertjan,

    I have been trying to use a Dark Theme with Java development.

    For the most part it works really well.

    The 2 areas that do not work are:

    debugging

    code coverage

    For both of these the IDE wants to use a light coloured background making the text under the 'current caret line' unreadable.

    I can post a bug / screen shot if it helps...

    Thanks, Simon.


  • Eli McMakin Tuesday, December 4, 2012

    I have not messed around with applying colors to the editor itself. But I made a dark theme that has beautiful readability for the editing screen. I called it Zenburn2012. I will update it for Netbeans 7.3, once that is released. You can check out screen shots, here: https://github.com/elimc/Zenburn2012


  • guest Tuesday, December 4, 2012

    @ Eli McMakin

    looks great! I appreciate your effort. Diff window in sidebar is not ajusted. Not sure if this is only background color


  • Yuri Trukhin Tuesday, December 4, 2012

    ugly dark theme... see Darcula in Intellij Idea 12


  • guest Wednesday, December 5, 2012

    ble, ... you should look at GTL laf and native colors from system


  • Konstantin Bulenkov Wednesday, December 5, 2012

    This is comparison with Darcula http://sta.lk/1c


  • guest Sunday, December 16, 2012

    It appears that the link to the themes.xml file is no longer available. Pls help me out with a new link where I can downlaod the theme. Thanks in anticipation for your kind gesture.


  • Geertjan Sunday, December 16, 2012

    It is indeed still available. But you need to ask yourself whether you know what XML is. If you do know what XML is, you'll know that when you open XML in a browser, you see nothing. You need to look at the source in the browser or download the file to see the content.


  • Neb Saturday, March 2, 2013

    Hello Geertjan.

    I have problem with netbeans, and i dont know where to put question.

    I will post it here.

    I customized dark theme, and when i am typing PHP, real-time error checker apears, and color of that row become white.

    I am sure it's simple solution, but i cant find it :)

    Tnx


  • Geertjan Saturday, March 2, 2013

    No idea what that means and the place to put the question is the NetBeans mailing list nbusers@netbeans.org.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha