This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
public void keyPressed(keyEvent e)
if(e.getKeyCode()==10) // trap enter key press
// i want here to do the same job of button clicking, which is defined in actionPerformed() method
i have created a JButton object and add action listener to it, defined actionPerformed() method, now i want that the same job will also be done when some one presses enter key on the JButton without writing the code again. How can i do this???
i want to know is there any way or any method which can automatically generate button click event?