java - How to change UI components color when some other Thread is running? -
i got game build (yes it's assignment university) need go on matrix represents board 2 states (boolean[][]). board can seen gui build using jlabels in 2 colors.
the idea have background process go each cell have update on matrix rules. these rules need change matrix cell value in ui side.
currently made seperate thread process goes on matrix , checks rule got, , thread responsible making change in ui.
by that, first thread working while second nothing.
so question is, best way change swing ui while other process working in background?
what done far this:
this.golthread = new thread(golr); golr.setrunningmode(true); golthread.start(); this.uithread = new thread(ui); ui.setrunningmode(true); uithread.start();
and tried use: swingutilities.invokelater(uithread);
Comments
Post a Comment