Closed warmans closed 4 months ago
Nice, thanks!
Can you move the RequestFocusListener
to the package com.willwinder.universalgcodesender.uielements.components
and also add a comment that credits the original source, something like:
/**
* Used for focusing the field in an JOptionDialog.
* Source from: https://tips4java.wordpress.com/2010/03/14/dialog-focus/
*/
public class RequestFocusListener implements HierarchyListener {
...
Resolves: https://github.com/winder/Universal-G-Code-Sender/issues/2473
I've not touched Java in many years so this solution is taken mostly from here:
https://tips4java.wordpress.com/2010/03/14/dialog-focus/
It seems to behave differently on different platforms. HierarchyListener was the only listener that worked on Linux.