複数のボタンがある場合、どのボタンがクリックされたかをキャプチャできるのだろうか。
この例では、//do something1 と //do something2 の部分に joinPoints で到達できますか?
public class Test {
public Test() {
JButton j1 = new JButton("button1");
j1.addActionListener(this);
JButton j2 = new JButton("button2");
j2.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
//if the button1 clicked
//do something1
//if the button2 clicked
//do something2
}
}