Displaying list upon certain selection

Hi,

I have a large number of lists. I'm trying to figure out a way to display a previously invisible list when a user selects a certain topic on a list. For example, I have these lists:

List OMEGAEPList =new List(5,false);

OMEGAEPList.add("Opto-Mechanical Systems");

OMEGAEPList.add("Diagnostics");

OMEGAEPList.add("System Engineering");

container.add(OMEGAEPList);

List OptMechSysList =new List(5,false);

OptMechSysList.add("SPPOL");

OptMechSysList.add("TAS");

container.add(OptMechSysList);

What I want is for OptMechSysList to be displayed if the user clicks "Opto-Mechanical Systems". I've read through many APIs, and have tried out Listeners, but I can never seem to get them to work. Can someone please give me advice?

Thanks,

Dan

[1084 byte] By [Djaunla] at [2007-10-3 2:57:51]
# 1
what exactly is the problem: (1) using Listeners or (2) displaying the right list / hiding an open list ?if it's (1) check this url: http://java.sun.com/docs/books/tutorial/uiswing/events/listselectionlistener.htmlthis tutorial explains how to do it and shows an
nitzana at 2007-7-14 20:47:13 > top of Java-index,Desktop,Core GUI APIs...
# 2
The problem is really both at the moment, but hiding/showing the lists should be easy to figure out. Thanks for the link to the tutorial. It looks confusing, but I should be able to figure it out by reading the API for the necessary components as well.
Djaunla at 2007-7-14 20:47:13 > top of Java-index,Desktop,Core GUI APIs...