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..
posted 5 years ago
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.