The main problem you will encounter when transfering stuff between Microsoft, Macintosh, and Linux is that Microsoft saves ASCII text files (such as Java source code) with both a carrage return and a line feed
\r\n everywhere you create a new line in your document. In Macintosh only a carriage return
\r is used, and in Linux only a line feed
\n is used.
There is a historical reason why two different characters that seem to do the same thing exist in ASCII. It is a throwback to an old pre-computer technology used by the news media for which ASCII was developed, called teletype. These machines were basically simi-intelligent typewriters. On a typewriter when you want to go to the next line you must return the carriage (basically the "print head") to the beginning of the line, then you must advance the paper one line. So in a typewriter, these are two seperate and distinct functions. When teletype met the fate of the dinosaurs and computers took over, we no longer needed two characters to represent a newline, and thus began the problem. The reason why the different OS's represent newlines in text documents differently, is because different companies programmed them. Obviously, these differences can make it a pain to back up source code in one OS and try to transfer it to another one.
The easiest way is to use FTP. Most FTP clients (such as the free
CoreFTP) will automatically convert ASCII files for you by default when you upload/download between operating systems. This makes it simple to upload numerous source code files at once from one OS, then retrieve them on another OS in the correct format (not to mention this is a good way to backup your projects anyway).
If FTP is not an option for you, another option would be to zip up your project and email it to yourself. However, it would then be necessary to manually convert between the two ASCII formats for each one of your .java files. The most time-consuming method is to fire up NetBeans on your new OS, then go through your sourcecode line by line and press enter everywhere a new line should go. A second option would be to take advantage of many text editors (such as Microsoft Word) which will make the conversions for you the first time you open the document. Another method is to write a conversion program (or google one that someone else has written) which reads in a file's bytes, and when it encounters "\r\n" it replaces that with "\n" (for example). Obviously, any of these manual conversion methods will be time consuming.
It is possible that the developers made NetBeans intelligent enough to use whatever ASCII format the sourcecode happens to be in (actually this would be extremely simple to program, it's just a matter of whether or not the developers of NetBeans considered it). If that is the case, then all you would need to do is copy your backed-up project into the NetBeans projects directory, and you'd be good to go.