This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
What you're calling the "local IP address" is probably the LAN address; that's actually the address that you're assigned by DHCP. It's the "real" address of the machine on the local network. You're probably using a NAT setup, which stands for "Network Address Translation;" this is the widely used system by which many machines on a LAN can share a single Internet address. Your computer does not actually know what that Internet address is -- the network packets are modified by the NAT box (i.e., a router attached to your LAN) for transmittal to the Internet. There's no API by which your local machine can find out what that address is.
You can get your LAN address with InetAddress.getLocalHost().getHostAddress() .
The WAN address (the official term for your Internet IP address) is only available through external resources. There are several websites that give you back your IP address, you can find several using what's my ip. You will need to parse the results though.