我正在使用eclipse,并且我有two TextField
,例如one text field contains IP address
和other contains normal text entry
。 当第一个文本字段包含本地系统的IP地址时,我可以在第二个文本字段中插入文本,而当IP是其他系统时 我必须禁用第二个文本字段。如何根据其他字段中的数据启用/禁用一个字段
我加修改,它检查是否启用/禁用第二文本字段中的第一个文本字段监听器。
My problem is when I type IP address then on every keystroke system hangs up
for some seconds.
我在我的modifyText功能
// 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 < ipAddr.length; i++)
{
if (i > 0)
{
ipAddrStr += ".";
}
ipAddrStr += ipAddr[i] & 0xFF;
}
// ipAddrStr contains the IP address
// For finding name of local host
String ownSysName = InetAddress.getLocalHost().getHostName();
为什么有每个按键后hault使用此代码?
请提出到实现这一目标的任何更好的办法。
在此先感谢。
谢谢,它的工作很好。 – user628083