Is this homework? I'll leave it as an exercise to John to covert from Perl to Java. Should be simple; especially with something like http://www.regexbuddy.com/.
:~$ perl -pe 's/\D//g;s/^(\d{3})(\d{3})(\d{0,4})(\d*)/(\1) \2-\3/'
5551234567
(555) 123-4567