/Users/lyon/j4p/src/addBk/addressBook/IndexPanel.java
|
1 package addBk.addressBook;
2
3 //IndexPanel.javaTextFieldPanel.java
4
5
6 import java.awt.*;
7 import java.awt.event.ActionEvent;
8 import java.awt.event.ActionListener;
9
10 public class IndexPanel
11 extends Panel
12 implements ActionListener {
13 List indexList =
14 new List();
15
16 public void actionPerformed(
17 ActionEvent e) {
18 int selName = indexList.getSelectedIndex();
19 System.out.println(
20 "command="
21 + e.getActionCommand()
22 + " index=" + selName
23 );
24 AddressBookMediator display =
25 new AddressBookMediator();
26 display.setRecord(selName);
27 }
28
29
30 IndexPanel() {
31 setLayout(
32 new GridLayout(0, 1));
33 add(indexList);
34 indexList.addActionListener(this);
35 }
36 }
37