Urgent help on IP Component in Java Swing.

M

maadhuu

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.
 
S

sam

Check out the java.net.Inet4Address and InetAddress. Or are u looking
for a Swing component that will store ur data. ???
 
S

sam

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top