JButton button1 = new JButton("klick mich");button1.addActionListener(this);.....public void actionPerformed(ActionEvent e) { if (e.getSource()==button1) { // tu irgendwas } else if (e.getSource()==button2) { // tu was anderes } ...}