• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UI Models - extend it or use default implementetions

 
Bernhard Woditschka
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm about implementing the user interface of the flight reservation system. While doing this I stumbeld over the following question regarding the models of the UI components (from- and to-checkbox and flights table):
As I never worked with Swing which practice is more common:
A) use the standard models that come with the JDK and supplying data to them with some glue code that accesses the database and feeds it into the model(s)
or
B) extend the existing mode (e.g. AbstractTableModel) in a way it understands to fetch the aproriate data from the database itself
any thoughts are most welcome.
BTW Merry X-mas
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to study Sun's How To Use Tables tutorial.
Eugene.
 
Bernhard Woditschka
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for pointing me to this article this helps a lot.
Looks like I'should write a custom model for the table to create the behavier I need, and stick with the default models for the combo boxes as they need no custom behaviour.
Cheers, Bernhard
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Looks like I'should write a custom model for the table to create the behavier I need, and stick with the default models for the combo boxes as they need no custom behaviour.

Sounds very reasonable, -- I think that's what most of us did.
Eugene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic