I recently shared some of the Swing interview questions we use with a fellow TechHui member. I thought I would post them here in case any of you are hiring Swing developers:
1. Why do all the lightweight Swing components inherit from JComponent? What are some of its important features?
2. Explain Swing's threading model
3. From an MVC perspective, what class represents the model of a JTextPane (Document)
4. Is it safe to share border objects in swing? How about colors? What makes instances of some classes safe to share while others are not?
5. Can I mix heavy and lightweight components? What happens if I do?
6. How would you implement a sorter on a JList?
7. Explain the main components of JRootPane.
8. What are some of the uses for a glass pane?
9. How would I render a java.awt.Color object as an actual color swatch in a JTable cell? (try to get them to explain custom renderers and editors)
10. What is the difference between paint and paintComponent in Swing components?
A few more advanced questions:
1. Explain how you would write a button that renders its text vertically.
2. Explain how you would implement column spanning cells in a JTable