Dark NetBeans

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.

Comments:

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.

Posted by guest on December 02, 2012 at 06:21 AM PST #

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

Posted by guest on December 02, 2012 at 07:30 AM PST #

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.

Posted by guest on December 02, 2012 at 07:48 AM PST #

thankx

Posted by guest on December 02, 2012 at 09:18 AM PST #

"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.

Posted by Geertjan on December 02, 2012 at 10:58 AM PST #

@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

Posted by guest on December 03, 2012 at 03:50 AM PST #

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.

Posted by Simon on December 03, 2012 at 07:53 AM PST #

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

Posted by Eli McMakin on December 03, 2012 at 10:52 PM PST #

@ Eli McMakin

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

Posted by guest on December 04, 2012 at 12:39 AM PST #

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

Posted by Yuri Trukhin on December 04, 2012 at 12:58 AM PST #

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

Posted by guest on December 04, 2012 at 11:30 PM PST #

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

Posted by Konstantin Bulenkov on December 05, 2012 at 05:31 AM PST #

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.

Posted by guest on December 16, 2012 at 03:24 AM PST #

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.

Posted by Geertjan on December 16, 2012 at 05:17 AM PST #

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

Posted by Neb on March 02, 2013 at 06:57 AM PST #

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

Posted by Geertjan on March 02, 2013 at 09:53 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« June 2015
SunMonTueWedThuFriSat
 
11
13
14
22
27
28
29
30
    
       
Today