Hmmm,
I seem to remember posting port scanning code in java here a year or so back. Take a look at (I think) the tutorials section.

Cheers,
cgkanchi