Hi Vijay
In Swing there is a facility of getActionCommand & setActionCommand.
While defining button just add below line.
JButton b=new JButton("save");
b.setActionCommand("save");
and when you are handling action performed...
public void actionPerformed(ActionEvent e) {
String nameOfButton = e.getActionCommand();
............
...........
............
}
Hi all
I am having a problem with JButton.
JButton b=new JButton("save");
how can i get the name of the JButton b.
Please give the anser for me