Hello ,
I need a java class that can act as an IP component ,basically for
entering IP addresses or subnet masks. Can someone help me out ? I need
the source code.
Thanks a lot.
Maadhuu.
sam - 11 Apr 2006 10:45 GMT
Check out the java.net.Inet4Address and InetAddress. Or are u looking
for a Swing component that will store ur data. ???
--
Suman
sam - 11 Apr 2006 10:56 GMT
Well its pretty simple here it goes
class MyIP
{
String ipAddress,subNetMask;
public MyIP(String ip,String subnet)
{
this.ipAddress=ip;
this.sunNetMask= subnet;
}
//Getters and setters
public String getIPAddress()
{
return ipAddress;
}
public String getSubNetMask()
{
return sunNetMask;
}
public void setIP(String ip)
{
this.ipAddress =ip;
}
public void setSunNetMask(String subNet)
{
this.sunNetMask = subNet;
}
}
This is a simple holder that will act as a your IP component. But there
are allready classes in .java.net package that you could use check out
that.
Cheers!!!
Suman