hello!

i written a program..it has for loop and calling thread.sleep for every
increment of for loop..

at the same time i initially called Swing Jtable which shows status of every for loop increment...

when i executing main program swing table appearing but no content filled for every execution ...

but it shows all content after for loop executed fully...

public  static void method() throws Exception {
		  StatusTable stab=new StatusTable();//swing component another class
			 for( row = 1;row <= rows;) {
			   			    				    	
			    	if(condition)
			    	{
					thread.sleep(500);

                              /////////////////
					rows going to add in StatusTable 

					///////////////////
						notify()    ////////exeption shown as java.lang.IllegalMonitorStateException
					//////////////////
			    	}
			   
			} 
		  	catch(Exception ioe) {
			    System.out.println("Error: " + ioe);
		  		}
	 	}

Well i am not an expert when it comes to java thread , but i guess this

1. u have mentioned a catch block , but i dont see the code for try block.

2. when the thread.sleep() is executed , the other concurrent thread must start running , provided u have mentioned the code in the run() method for the other class object.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.