Urgent Java help needed, please!
Urgent!
Help!
As part of an old assignment, I was told to discuss two uses for a layout of buttons/text areas/labels. Being the smart-arse that I am, I decided to go a little more advanced, and show off my technical know-how. I discussed a parallel LCD configuration device, and a network monitoring tool.
Oh guess what! The next assignment is - program one of your ideas.
I've been doing java for about a month now (2x1 hour lectures a week + basic fumbling around with JCreator). That's seriously not enough to be able to get this assignment finished for tomorrow. So I'm begging for a little help, here - just a pointer in the right direction would be massively appreciated.
I have this:
Code:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.io.*;
public class MyIP {
public static void main(String args[]) {
String ip = new MyIP().myIP();
System.out.println(ip);
}
public String myIP() {
try {
return InetAddress.getLocalHost().getHostAddress();
}
catch (IOException e) {
return "unknown";
}
}
}
What I need it to do, however, is to print the IP on a Label... I really have no idea how to incorporate the above into my code. Gah!