Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

how to refresh window in java peridically

  Asked By: Lourdes    Date: Feb 09    Category: Java    Views: 1114
  

I am having problems designing my GUI. I am having this main method :

package gui;
import java.io.*;

public class run {

RunUSBControllerTest test;

public run ()throws NoSuchMethodException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException {
for(;;){
RunUSBControllerTest test = new RunUSBControllerTest();
//Graph01 graph = new Graph01();
graphing graph = new graphing();
}
}
public class graphing {

public graphing() throws NoSuchMethodException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException {

//System.out.println("before "+test.y[3] +"" +test.y[4] +""
+test.y[5]);
Graph01 graph = new Graph01();
//System.out.println("after "+test.y[3] +"" +test.y[4] +""
+test.y[5]);

}
}

public static void main(String[] args) throws NoSuchMethodException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException
{

run r = new run();

}

}


The class RunUSBControllerTest just brings data into a double array
variable and then that data is plotted by the graph01 object.. the
problem is that when the data comes in a gui is created for it
showing a graph. but when new data arrives instead of refreshing the
same gui it opens up a new frame on it. I tried to make this into a
different class as well as tried using graph object in different
method so that when it exits the method it kills the object and thus
the window. Can somebody how can i refresh this window whenever data
comes in.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Komal Mohammad     Answered On: Feb 09

threads are lightweight versions of process. they share the memory with other
threads within the process and executes concurrently.. In a single
process machine it seems that it is executing normally but actually they are in
sequential. the order in which threads come into execution are determined by
the Operating System in which the JVM runs

you can override wait() and Notify() functions in java.lang.Thread class  and

synchronized identifier can also used for Synchronization of process



hope this will solve your problem if not please contact me with more details

 
Didn't find what you were looking for? Find more on how to refresh window in java peridically Or get search suggestion and latest updates.




Tagged: