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?