D
D
d3coy_002019-12-17 01:07:16
Java
d3coy_00, 2019-12-17 01:07:16

Binding a key on a keyboard to a button on a field in Swing?

Hello, there is a form with two buttons on it, how can I bind pressing a certain key on the keyboard to pressing a button on the form, so that when the key is pressed, the button is pressed?

Preferably a code sketch with details, thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
striver, 2019-12-17
@striver

Well, relatively easy to do using the menu. Create the necessary bookmarks and items - add keyboard shortcuts, and then attach what you need to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question