Originally posted by Daniel Simpson:
Hey, I'm doing B&S and I am having trouble with my JTable freezing when I attempt to book a Contractor multiple times. Here is what happens:
1)Contractor is available to book-->Click on row, enter id, hit book. That works fine.
2)Select the same contractor and try booking: "Sorry record #.. is already booked."
3)Again, try doing the same thing as step 2, but when I click book, the book button freezes and the whole application hangs. Any ideas?
Here is a little rough snippets of code:
Here is a snippet in my GUIController:
Hope my code snippets help with this problem. Does anybody have any idea why my program would hang when it does that? Has anyone else experienced problems with that? My search works fine, I can hit the search button 100 times in a row and it doesn't hang. Hmmmm....
[ December 31, 2004: Message edited by: Daniel Simpson ]
Do you do your database access on the Event Dispatch
Thread? Does another thread try to update the GUI? Either of these could cause problems with responsiveness. I do the following:
All business actions that might access a file or the network start a thread to do it. When that action completes it uses invokeLater to get the GUI work done on the EDT. This way there are no possible blocking actions on the EDT and all GUI activity does run there.