Hi..I am attaching buttons from the JButton array and I need to know the value of the button. so if jArray[0] = new JButton("User1") then when I right click on this I want the value "User1" When I simply click on this I can get it by - e.getActionCommand() But in the MouseEvent it doesnt work.. So please let me know if there is any method for that or not.. thanks Pratik
Jianfei Yang
Greenhorn
Joined: Aug 23, 2001
Posts: 4
posted
0
You can call getSource() of MouseEvent and get the text of JButton from source object which trigger this event.
Pratik Khetia
Ranch Hand
Joined: Jun 29, 2001
Posts: 50
posted
0
Hey - I did that using string manipulation but is there any direct method to get the text of the JButton ??