File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Threaded Booking Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Threaded Booking Method" Watch "Threaded Booking Method" New topic

Threaded Booking Method

David Reck
Ranch Hand

Joined: May 25, 2001
Posts: 37
I am struggling whether or not I should make my booking method threaded. I can make the method treaded pretty easily but my problem is updating the JTable display after the booking is completed successfully. If the method is threaded the user can perform a new search before the booking is completed. So that flight might not be in the table data and if the flight is still there simply updating the available seats value also may be incorrect because the values might have changed between the clients booking and other bookings. I have considered performing the search again after the booking succeds but that could be a pain for the user if they are viewing the table data. I would appreciate anyones suggestions.
Narayan Veeramani

Joined: Jun 06, 2001
Posts: 25
I am not sure whether making the Booking method multithreaded
will be useful since anyway the user would like to view whether
the Booking attempt was succesful or not before proceeding
with a new flight search.
Rick Fortier
Ranch Hand

Joined: Jun 04, 2001
Posts: 147
I am using the CardLayout with three screens:
1. Search - asks user to select Origin and Dest
2. Results - the JTable with results and a numSeats combobox Book button, Search Again button
3. Confirmation - displays the success, failure message. Search Again button
So my screen does not have to refresh. I don't think this answer helps you though. My user can't see my Results screen unless they do a new search.
I agree. Here's the link:
subject: Threaded Booking Method
It's not a secret anymore!