Setting button mnemonic key events without having to use ALT

Is there a way to set a button key event in Java so that Alt does not have to be pressed. For example, when this is used setMnemonic(KeyEvent.VK_DELETE) it is required for Alt + Delete to be pressed in the application. How can I get around this? Thanks.

Answer:1

I would take a look at the key bindings tutorial. You can specify any KeyStroke to perform any Action.

Answer:2

Below is a code snippet of ArrayList, which either takes in the 'initialCapacity' provided by the user or default of 10. My question - why was 10 not a static constant ? I guess constants are used ...

If I have a regular expression, how do I return the substring that it has found? I'm sure I must be missing something obvious, but I've found various methods to confirm that that substring is ...

While I do understand some of the corner-cases of generics, I'm missing something with the following example. I have the following class 1 public class Test<T> { 2 public static void main(...

My android app needs communicate with server when it's (application) opened. For that I want to use socketIO Java client. Do I need to use BoundService for sockets (it should run on background)? ...