/Users/lyon/j4p/src/addBk/address/LabelSelectorPanel.java

1    package addBk.address; 
2     
3    import javax.swing.*; 
4    import java.awt.*; 
5     
6    public class LabelSelectorPanel 
7            extends JPanel { 
8        String labelNames [] = { 
9            "A", "B", "C", "D", "E", 
10           "F", "G", "H", "I", "J", 
11           "K", "L", "M", "N", "O", 
12           "P", "Q", "R", "S", "T", 
13           "U", "V", "W", "X", "Y", "Z" 
14       }; 
15       JLabel labelArray[] = new JLabel[labelNames.length]; 
16    
17       LabelSelectorPanel() { 
18           setLayout(new GridLayout(0, 1)); 
19           for (int i = 0; i < labelNames.length; i++) { 
20               labelArray[i] = new JLabel(labelNames[i]); 
21               add(labelArray[i]); 
22           } 
23       } 
24   }