using javax.swing and concurrent.Semaphore