If you dig around, you might find some sort of AJAX control for IP addresses, but there's nothing wrong with your idea. You can use a 4-element array to hold the 4 parts of the IPV4 address. The
String split() method can help you break the address parts out from a string.