How to Enable/Disable one field on the basis of data in other field
<p>I am using eclipse and I have <code>two TextField</code> such that <code>one text field contains IP address</code> and <code>other contains normal text entry</code>.
When first text field contains IP address of local system I can insert text in the second text field while when IP is of some other system 
I have to disable the second text field.</p>

<p>I have added modify Listener on the first text field that checks whether to enable/disable second text field.</p>

<pre><code>My problem is when I type IP address then on every keystroke system hangs up 
for some seconds.
</code></pre>

<p>I am using this code in my modifyText function </p>

<pre><code>// Here ipAdd is the value of the first Text field on which i have add Modify Listener

InetAddress addr = InetAddress.getByName(ipAdd);
byte[] ipAddr = addr.getAddress();
String ipAddrStr
        for (int i = 0; i &lt; ipAddr.length; i++)
        {
            if (i &gt; 0)
            {
                ipAddrStr += ".";
            }
            ipAddrStr += ipAddr[i] &amp; 0xFF;
        }
        // ipAddrStr contains the IP address
// For finding name of local host

String ownSysName = InetAddress.getLocalHost().getHostName();
</code></pre>

<p>Why there is a hault after every keystroke.?</p>

<p>Please suggest any better way to the achieve this.</p>

<p>Thanks in advance.</p>
