There are several methods of getting the source, detailed here: http://www.netbeans.org/community/sources/

For a development version:

cvs -d :pserver:This email address is being protected from spambots. You need JavaScript enabled to view it.:/cvs login
   cvs -d :pserver:This email address is being protected from spambots. You need JavaScript enabled to view it.:/cvs co standard

For e.g. NetBeans 4.1, use -r release41.

Most Linux machines at least have the command-line CVS client installed by default - try typing simply cvs at a command prompt. You might want to visit any of several good sites such as http://www.cvshome.org/ which lists available CVS clients for different platforms, their strengths and weaknesses. Alternatively, you may wish to use the CVS support built into the NetBeans IDE itself. You should also read the Cederqvist manual included with most CVS clients for general information.

Source: NetBeans FAQ