private static void autocomplete(JTextField address, JTextField subnet, JTextField gateway, boolean force) {
try {
// attempt auto-completion
String addr = address.getText(), mask = subnet.getText();
mask = (mask.isEmpty())?"255.255.255.0":mask;
Subnet s;
if (addr.contains("/")) s = new Subnet(addr);
else s = new Subnet(addr, mask);
address.setText(s.getInfo().getAddress());
if (subnet.getText().isEmpty() || force) subnet.setText(s.getInfo().getNetmask());
if (gateway.getText().isEmpty() || force) gateway.setText(s.getInfo().getLowAddress());
} catch (Exception ex) {/*just trying, no harm done*/}
}