tags:

views:

25

answers:

2

I am an inexperienced Java Swing developer and I need to create a JDialog which displays three different lists of data. The user's selection of an item in the first list will update the content of the second list and the selection of an item in the second list will update the content of the third list. Also when the dialog is launched the first item of all three lists should be selected.

Can someone suggest me an approach to do such a thing? Should I use three or JLists?

Thanks in advance!!!!

+1  A: 

The definite tutorial on JList and its selection listener should be enough to get you started.

Geoffrey Zheng
A: 

As suggested by Geoffrey Zheng, JList is an excellent choice. As an alternative, you might also look at JComboBox; there's a two-tier example here. Either component can be added to JOptionPane, as shown here.

trashgod