自分ではこういうのを作ってみたのですが、GUIで作るのは初めてなので本とか参考にしてもうまくいきません・・・

class lis extends JPanel implements ActionListener{
JButton button1,button2;

lis(){
JButton button1 = new JButton("名前");
JButton button2 = new JButton("番号");
add(button1);
add(button2);
button1.addActionListener(this);
button2.addActionListener(this);
mainrepaint;
}

public void actionPerformed(ActionEvent e){
if(e.getSource() == button1){

}
else if(e.getSource() == button2){
}
}