java - Opening a JFrame Object: Event Sequence -


i tried searching documentation on , found virtually nothing. must looking in wrong place. have button used open jframe object. i've seen, folks recommend opening jframe using statement: myframe.setvisible(true);

when jframe opens, there several sql statements run retrieve data required make jframe usable. ensure data retrieved , loaded jframe's controls before jframe becomes visible user. thought know event sequence, know, event fired first, second, third... can find event in chain enables me keep jframe hidden until ready user interaction. taking time reply.

because of unknown latency in accessing database, you'll want read required data in background avoid blocking event dispatch thread. swingworker common approach. in way, can invoke frame's setvisible(true) method promptly, disabling controls don't make sense while data loads. results can displayed become available , progress shown, resulting in reduced perceived latency. later, in implementation of done() can enable disabled controls. related example shown here, , variation shown here.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -