Home » Java » Java Swing GUI: How to do a field that stores a keybind for a specific function and that – when clicked on it- asks for a key?-Exceptionshub

Java Swing GUI: How to do a field that stores a keybind for a specific function and that – when clicked on it- asks for a key?-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

sorry if the title is confusing but I just want something like in this video at 00:25
https://www.youtube.com/watch?v=ReoXncADFFw&t=819s
I know I probably have to use keylistener and mouseadapter on a textfield or something but there are more things like: how do I do it that the field is not editable and can onlny be clicked like in the video etc?
I would appreciate your help very much :)! This is the last step for my gui to be complete 🙂

How to&Answers: