This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Zero to AI - A non-technical, hype-free guide to prospering in the AI era and have Nicolò Valigi and Gianluca Mauro on-line!
See this thread for details.
Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

update data in the JTable

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,everyone:
sorry my English.
I booked a record in client,
this record is updated succeed,
does need to update the data in the JTable?
 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jofer,
You should notify the TableModel that the data has been updated. Check the Javadoc for AbstractTableModel, which I assume you are extending either directly or through DefaultTableModel, to find out how.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the record is successfully booked, do I need to make it disappear from JTable? I personally think that booked records need to be removed from table. What do you think?
Thanks!
Seid
[ December 11, 2003: Message edited by: Seid Myadiyev ]
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I don't think that you should remove any record from the JTable even if the available seats are 0. I've made like this and if the available seats where 0 the book seat button was disabled for that specific row in the JTable.
Miguel
 
Seid Myadiyev
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Miguel,
Does your previous post also mean that after find method returns even booked rooms appear in the table but they cannot be booked because book button becomes disabled when book record is selected?
Do you let the user know why your book button is disabled, by means of ToolTip over booked record, for example?
Thanks!
Seid
[ December 11, 2003: Message edited by: Seid Myadiyev ]
 
Miguel Roque
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

Does your previous post also mean that after find method returns even booked rooms appear in the table but they cannot be booked because book button becomes disabled when book record is selected?


Yes

Do you let the user know why your book button is disabled, by means of ToolTip over booked record, for example?


I have put only a tooltip informing what the button does, that is, reserves seats (it was the fly by night assignment, but is similar to this one) and if no seats where available 0 was presented in the JTable and the button becomes disabled without changing the tooltip.
Miguel
 
Seid Myadiyev
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Miguel,
I am sorry, to ask again, I am just trying to understand your design.
If your find method returns booked records as well doesn't it then return all records?
Thanks!
Seid
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Miguel means that when you especially select one row, his program will check the seats availability for that entry, if no seats are available, book button is disabled; if seats are available, book button are enabled.
Miguel wrote:

I've made like this and if the available seats where 0 the book seat button was disabled for that specific row in the JTable


Regards,
Jianhua
[ December 11, 2003: Message edited by: Jianhua Ren ]
 
Seid Myadiyev
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Jianhua!
Seid
[ December 11, 2003: Message edited by: Seid Myadiyev ]
 
Miguel Roque
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

Originally posted by Seid Myadiyev:
Miguel,
I am sorry, to ask again, I am just trying to understand your design.
If your find method returns booked records as well doesn't it then return all records?
Thanks!
Seid


In my design, that was the FlyByNight assignment, the find method allways return the flights from one destination to other even if no seats were available.

I think Miguel means that when you especially select one row, his program will check the seats availability for that entry, if no seats are available, book button is disabled; if seats are available, book button are enabled.


That's it. In the JTable, one of the columns shows the available seats. When one row is selected, it reads the available seats and if it's 0 then the button is disabled. It's simple but it doesn't give you milions .
Miguel
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic