简体   繁体   中英

Load JList for cells of 1st column in JTable

Is there any way to load JList on the first column of JTable on click?

The table has zones in the 1st column (with multiple locations in every zone). I want to show zone locations to the user in a list, on zone click.

I am looking for it from 1 and half day. I don't want to put my code here because there is a lot of functionality in my table class.

One approach would be to add a ListSelectionListener to the table, as shown here , and update your ListModel according to the row selected. A JList listens to its own ListModel , so the update should be automatic.

图片

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM