Hi all I have written an application that uses swing components as the front-end to a database. However, users being what they are, they have requested that the key used to "click" buttons be changed from the default (space bar on Win32) to the Return key. I am looking for a decent way to do this. With standard JButtons, I have come up with the hack of extending the JButton class and adding a key listener which calls the doClick() method in response to the user hitting the return key when the button has focus. Fine. However, I am also making extensive use of JOptionPane static methods, whereby I just pass in an array of Strings and the rest is done for me. I know I could replace the array of Strings with an array of my extended JButton class objects, but this seems like an ugly solution involving unnecessary extra coding. I can't help feeling that there is a simple way to achieve this - can anybody point me in the right direction? Many thanks Michael ------------------ "One good thing about music - when it hits, you feel no pain" Bob Marley
"One good thing about music - when it hits, you feel no pain" <P>Bob Marley