This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Use the UBB "CODE" tags. On the editing screen, look below the big textarea and you'll see a bunch of buttons; one button says "CODE". Push it to create a set of CODE tags. Put your code in between those tags, and any formatting will be preserved.