I was trying to make a jFrame which had a button & a text-area/label, the motive being able to retrieve my systems IP Address, the problem is, when I use this code
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try
{
InetAddress ownIP=InetAddress.getLocalHost();
jTextField1.setText(ownIP.getHostAddress());
}
catch (Exception e)
{
jTextField1.setText(e.getMessage());
}
}
But then this gives me back the loop back IP Address, 127.0.0.1 :( I have static IP configured on my system, but then too that IP does not show up I use NetBeans IDE 7.0 & Ubuntu 11.04