1、遍历查找,速度相对慢,不过对于小规模数组来说不是问题:
01 |
import java.awt.*; |
02 |
import java.awt.event.*; |
03 |
import javax.swing.*; |
04 |
05 |
/** |
06 |
* |
07 |
* |
08 |
*/ |
09 |
public class ShowIndexDemo extends JFrame implements ActionListener |
10 |
11 |
public static final int BUTTON_ARRAY_SIZE 5 ; |
12 |