Java Warning Message

reev007's Avatar, Join Date: Jul 2012
Newbie Member
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:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
InetAddress minta= InetAddress.getLocalHost();
FileWriter fstream = new FileWriter("List_IP.txt");
PrintWriter out = new PrintWriter(fstream);
		}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 ......

Last edited by shabbir; 23Jul2012 at 10:21.. Reason: Code blocks
ManzZup's Avatar, Join Date: May 2009
Skilled contributor
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