Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Proper design question

 
Greg Belyea
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys

I am trying to solve a problem and have been out of the game for a bit... question... i have created a GUI Panel that has drag and drop capability, i drag an id from the left list box and drop in the right if i want to disable something for that id.. if i drag it back out of the right to left then that id is enabled again... that all works great, my problem is i would like to leave that as a dumb panel that i just pass a couple vectors to and it does it's thing... problem is I need it to add and remove records from a database table though when items are successfully added and removed to/from the right hand list..

I don't wanna stick that logic in the simple GUI panel that could be reused if i don't, how should i design this properly so that any business specific logic is not tainting my new control.. I almost went quick and dirty to get it done, but i don't really want to do that... If it's not reasonably simple i could just stick a couple buttons there for save and cancel and they could grab the current list models, but i'd almost like it to be instant with no more steps..

Cheers
GB
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you could give the Gui a public method addListDataListener(ListDataListener ldl) that would allow an outside class to listen to the JList's data model.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic