Having a JList go to a specific item when a user presses a key

JListKeyPressed.java:

import javax.swing.*;
import java.awt.event.*;
 
public class JListKeyPressed extends JFrame {
   private JList list;
   private JPanel p;
 
   public JListKeyPressed() {
      super("JListKeyPressed");
      p = new JPanel();
      final String data[] = {"ah","bh","ch","dh","eh","fh","gh","hh","ih"};
      list = new JList(data);
 
      list.addKeyListener(new KeyAdapter() {
         public void keyPressed(KeyEvent e) {
            for(int i = 0; i < data.length; i++) {
               if(data[i].charAt(0) == Character.toLowerCase(e.getKeyChar())) {
                  list.setSelectedIndex(i);
               }
            }
         }
      });
 
      setContentPane(p);
      p.add(list);
      setSize(300,300);
 	
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
            dispose();
            System.exit(0);
         }
      });
 	
      setVisible(true);
   }
 
   public static void main(String args[]) {
      JListKeyPressed j = new JListKeyPressed();
   }
}