title: JList with enter key
body: <p>I have a <code>JList</code> already having 3 elements.  Now what I want is if I press the enter key on that element i want to open a new <code>JList</code> with new list of create,alter,view as i mentioned below.. I have tried the below code:</p>
  
  <pre><code>Object l1=master.getSelectedValue();
  int key = evt.getKeyCode();
  if (key == KeyEvent.VK_ENTER) {
           Object ind = master.getSelectedValue();
       //data.add(master.getSelectedValue());
       //master.setListData(data);
           DefaultListModel listmodel=new DefaultListModel();
           listmodel.addElement("Create");
           listmodel.addElement("View");
           listmodel.addElement("Alter");
             //  String[] data = {"Create","View","Alter"};
               JList list = new JList(listmodel);
                list.setFocusable(true); 
  </code></pre>