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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -