Results 1 to 1 of 1
Thread: process synchronisation:
- 03-10-2011, 11:28 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 1
- Rep Power
- 0
process synchronisation:
Can any one help me in solving this:
On click of PREV button it should pass command continuosly upto 1000 times or until end button is clicked.
When prev process going on, end button click is not recognising.
Here is the code...
public void run() {
super.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
while(true)
{
switch (command)
{
case DRCCommandButton.PREV: command=PREV;
EndButton.setEnabled(true);
prev();
break;
case DRCCommandButton.END: command= END;
end();
return;
default:drcConnection.sendDRCCode(command);
}//switch
command = PREV;
}//while
}});
}
public void prev(){
super.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
System.out.println("new");
if (command==4) end();
}
});
System.out.println("PREV :"+prevcount++);
try {
System.out.println("Sleep");
Thread.sleep(10000);
}
catch (InterruptedException e1) {
e1.printStackTrace();}
drcConnection.sendDRCCode(37);
//prevcount=0;
}
public void end(){
System.out.println("Ending...");
prevcount=MAX;
//thread.stop();
}
Similar Threads
-
how to scroll 2 images at a time(synchronisation),both images are on different panels
By smitharavi in forum AWT / SwingReplies: 4Last Post: 12-16-2010, 05:32 PM -
Synchronisation Issue?
By Jithu in forum New To JavaReplies: 1Last Post: 10-11-2010, 10:06 AM -
Synchronisation problem
By Joshy910 in forum SWT / JFaceReplies: 3Last Post: 08-12-2010, 04:52 PM -
thread synchronisation
By nabila.abdessaied in forum Threads and SynchronizationReplies: 0Last Post: 04-01-2009, 06:11 PM
Bookmarks