midipedalflag=false; // the flag set by midipedal
do { // and space bar
} while (!midipedalflag);
midipedalflag=false;
midipedalTest.setSelected(false);
The only thing this code seems to be doing is to setSelected(false) when the midipedalflag is set to true.
Why not get rid of this code and have the method that sets midipedalflag true do the setSelected(false) itself?
BTW
Multipedal should do:
Code:
midipedalflag.notify();
The thread issuing the notify must have the lock on the monitor(midipedalflag):
sychronized(midipedaflag) {
midipedalflag.notify();
}