package addBk.addressBook;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class IndexPanel
extends Panel
implements ActionListener {
List indexList =
new List();
public void actionPerformed(
ActionEvent e) {
int selName = indexList.getSelectedIndex();
System.out.println(
"command="
+ e.getActionCommand()
+ " index=" + selName
);
AddressDisplay display =
new AddressDisplay();
display.setRecord(selName);
}
IndexPanel() {
setLayout(
new GridLayout(0, 1));
add(indexList);
indexList.addActionListener(this);
}
}