Java Swing UIManger causes slowness -


i experienced weird issue in real time stock prices gui java application. problem code:

inputmap im = (inputmap)uimanager.get("button.focusinputmap"); im.put(keystroke.getkeystroke("pressed space"), "none"); im.put(keystroke.getkeystroke("released space"), "none"); 

if call main thread whole gui application becomes slow, lagging when scrolling table up/down. fix seems to call code swing thread.

what going on when wrong thread calls it?

the fix seems to call code swing thread.

actually fix call processing logic separate thread, not event dispatch thread (edt). edt swing thread responsible responding events , painting gui, should not execute long running code or gui becomes unresponsive.

read section swing tutorial on concurrency more information. can use swingworker execute long running code.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -