Logo F2FInterview

Swing Interview Questions

Q   |   QA

This is a trick. most people would say ‘add a KeyListener to the JComboBox’ - but the right answer is ‘add a KeyListener to the JComboBox’s editor component.’

Swing components should be updated directly only in the context of callback methods invoked from the event dispatch thread.

A callback implementation like ActionListener.actionPerformed or MouseListener.mouseClicked is taking a long time to execute thereby blocking the event dispatch thread from processing other UI events.

The only thread-safe methods are repaint(), revalidate(), and invalidate()

The AWT event dispatcher thread is not a daemon thread. You must explicitly call System.exit to terminate the JVM.

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: