The application is very fast, used for trading of many futures and options markets every day. We discovered that when specific buttons were on focus a space bar would cause an unintended click. Therefore we came with the focus input map fix. However calling this "fix" from non EDT thread would cause the whole application to function in "limp" mode, which is crazy.
This has nothing to do with any processing or races. Here is more context:
//SLOW:
public static void main(String[] args)
{
InputMap im = (InputMap)UIManager.get("Button.focusInputMap");
im.put(KeyStroke.getKeyStroke("pressed SPACE"), "none");
im.put(KeyStroke.getKeyStroke("released SPACE"), "none");
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
//just GUI no processing, no changes
startAndRunGUI();
}
}
}
//FAST:
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
InputMap im = (InputMap)UIManager.get("Button.focusInputMap");
im.put(KeyStroke.getKeyStroke("pressed SPACE"), "none");
im.put(KeyStroke.getKeyStroke("released SPACE"), "none");
//just GUI no processing, no changes
startAndRunGUI();
}
}
}