I read about SwingWorker but couldn't figure out how to use.
My bookTicket() goes something like this ::
Double click on the JTable row
MouseListener picks up - transfers to Controller which calls
bookTicket() method
bookTicket() method -
calls lock()
{
if record locked - wait()
// from here I want to tell the client that his //
thread is waiting - and prevent him from using the JTable
when notifyAll() called -- moves out of wait
// again inform client that his request is now being processed
}
calls readRecord()
checks avail seats
calls modify()
calls unlock()
{
checks ClientID and removes record from HT
notifiesAll()
}
Now how do you perform invokeLater()
"If not, I would invokeLater at the GUI and from that call the lock while I would write to the Status line (or window)"
My main concern is that if the Client who is blocked, keeps doubleClicking on the JTablerow( thinking nothing is happening) it could create another problem - machine hangs. Is there a way we can disable listeners to the JTable till the lock is removed??