Hi Vijay
In Swing there is a facility of getActionComman d & setActionComman d.
While defining button just add below line.
JButton b=new JButton("save") ;
b.setActionComm and("save");
and when you are handling action performed...
public void actionPerformed (ActionEvent e) {
String nameOfButton = e.getActionComm and();
...............
Leave a comment: