1.Steps for creating a thread:
- Place the code for the task into the run method of a class that implements the Runnable interface.
- Construct a Thread object from the Runnable. Threat t=new Thread(Runnable object);
- Start the thread: t.start();
2. In general, the block is simplified ad
button.addActionListener( f() );
In the function f(){
new Runnable(
run(){
task....
interactive with component;
}
);
}