java - Which thread runs all the AWT/swing event handling code? -


i new java , there interview question graduate role didn't understand, can tell me thread , purpose please.

swing ui toolkit single threaded (in sense unsafe call of swing libraries other thread). ui events, both rendering , dispatching them done edt thread.

so on clicking @ button on desktop. os gives notification edt receives event , triggers callback function registered button click. code, when action (for ex: repaint screen or draw image). edt delivers change os , rendered on screen. hence 2-way interaction.

because mentioned swing ui toolkit single-threaded. hence advisable call of swing libraries edt usign system.invokelater. more info here.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -