hello all, I have a problem with my program in java netBeans... I created an IP monitoring program and there will be a "warning message" when there is a change of IP. This is a program that I created: Code: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: try{ InetAddress minta= InetAddress.getLocalHost(); jTextField1.setText(minta.getHostAddress()); jTextField2.setText(minta.getHostName()); FileWriter fstream = new FileWriter("List_IP.txt"); PrintWriter out = new PrintWriter(fstream); out.write(minta.getHostAddress()); out.close(); }catch (IOException e){//Catch exception if any System.err.println("Error: " + e.getMessage()); program detects the IP and then save the file "txt". program runs automatically, and when the IP changes, the program will give "warning message". I was wondering how to make it .. anyone can help me? pleaseee ......
make a daemon thread to monitor the change of IP if any change that thread calls a the main program to notify of the change