Porting Code (e.g. Java)

Hey, I'm new to Mac programming generally so pardon any stupidness and feel free to patronise as much as possible.

I was just wondering if porting windows based code (e.g. visual studio) can be done relatively easily? I realise it requires different libraries or whatever, but are there any standards that allow code to be moved from one platform to another?

I ask particularily as I'm coding in Java at the minute, using rubbish JCreator to compile it, and it would be great if the content could be copied and pasted to the nicer developer tool? Like open a Java project and include the Java files. Obviously it would steer clear of the interface builder but just give me the ability to work at home.

Sort of a reiteration of OSC's post, Java use a virtual machine that doesn't *need* porting to other platforms once you find the way you're using to run the program -- being a student, that's usually with Terminal
All you really need to make Java code work is Project Builder and the Terminal. Then you're off.

C++ code ... you should realy "#if 0" your Library-specific lines and gradually introduce each library to see which ones are supported, but expect to rewrite a lot of the preprocessed-out code. Especially w/ VS C++, which I had the misfortune of using. Gaaaahhh.... MS needs to work on their compiler.
IMO, you haven't seen preprocessor spagetti until you try making a crossplat program with all variations in the same source files.