Start New Discussion within our Software Development Community


i written a 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;) {

					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.

This article has been dead for over six months. Start a new discussion instead.