0

Bear with me. I have a denist program with 3 JList's. A patient JList that adds patients, a history jlist that adds the patients history and an invoice history that should link with the history jlist and the patient jlist. I have them all writing to each Jlist respectably but my aim is: when i click on a patient , their history will pop up in the history JList and the invoice will appear in the Invoice Jlist.

How would i go about this? I have id's in each jlist. I think this would be the right way to go about it.

More than happy to send the program via email if needed.

Need help!!

Thanks.

4

1 回答 1

1

Well, just add ListSelectionListener(s) to your JLists and when the selection changes find the appropriate object for your other JLists to display.
您可以调用list.getModel().getElementAt(i)以获取列表中包含的元素。通过您必须识别链接项目的任何机制找到合适的。一旦您拥有该项目,只需调用即可list.setSelectedValue(yourObject, shouldScroll)

于 2013-04-30T22:00:43.793 回答