swing - Java Wait for Border adjustment to be made in Grid Layout -
hello have tile (jlabel) on grid layout panel call tile.setborder(borderfactory.createemptyborder()); update border of tile call lengthy method, image updated after lengthy method done. want border adjustment done , image updated on screen before calling method, how do this?
try swingutilities.invokelater()
make sure edt initialized properly.
please have @ below post know more this.
sample code:
swingutilities.invokelater(new runnable() { @override public void run() { // gui related code fall here tile.setborder(borderfactory.createemptyborder()); // not add lengthy method call here } });
for more info read comments below.
Comments
Post a Comment