Some genuine JAVA Swing interview question and answers asked during interviews on various java programming interviews
1. What is Java Swing?
2. What is JFC?
3. What is AWT?
4. What are the differences between Swing and AWT?
5. What are heavy weight components ?
6. What is lightweight component?
7. What is double buffering ?
8. What is an event in Swing?
9.What is an event handler in swing?
10. What is a layout manager?
11. What is clipping?
12. Which containers use a border Layout as their default layout in swing?
13. What is the preferred size of a component?
14. What method is used to specify a container's layout?
15. Which containers use a FlowLayout as their default layout?
16. Which method of the Component class is used to set the position and size of a component?
17. What is the What is the difference between invokeAndWait() and invokeLater()? ?
18. Why should any swing call back implementation execute quickly?
19. What is an applet?
20. What is the difference between applications and applets?
21. Which method is used by the applet to recognize the height and width?
22. When we should go for codebase in applet?
23. What is the lifecycle of an applet?
24. Which method is used for setting security in applets?
25. What is an event and what are the models available for event handling?
26. What are the advantages of the event-delegation model over the event-inheritance model?
27. Can a class be it's own event handler? Explain how to implement this?
28. Why does JComponent have add() and remove() methods but Component does not?
29. How would you create a button with rounded edges?
30. What is the difference between the "Font" and "FontMetrics" class?
31. What class is at the top of the AWT event hierarchy?
32. Explain how to render an HTML page using only Swing?
33. How would you detect a keypress in a JComboBox?
34. Why should the implementation of any Swing callback (like a listener) execute quickly?
35. If your UI seems to freeze periodically, what might be a likely reason?
36. Which Swing methods are thread-safe?
37. Why won't the JVM terminate when I close all the application windows?
38. What is an event?
39. What is an event handler ?
40. Which containers use a border Layout as their default layout?
41. What is source and listener ?
42. What is controls and what are different types of controls in AWT?
43. What is the difference between choice and list?
44. What is the difference between scrollbar and scrollpane?
45. What is a layout manager and what are different types of layout managers available?
46. How are the elements of different layouts organized?
47. What are types of applets?
48.What are the restrictions imposed by a Security Manager on Applets?
49. What is the difference between the Font and FontMetrics classes?
50. What is the relationship between an event-listener interface and an event-adapter class?
51. How can a GUI component handle its own events?
52. What is the difference between the paint() and repaint() methods?
53. What interface is extended by AWT event listeners?
54. What is Canvas ?
55. What is default Look-and-Feel of a Swing Component?
56. What are the features of JFC?
57. What does x mean in javax.swing?
58. What are invisible components?
59. What is the default layout for a ContentPane in JFC?
60. What does Realized mean?
61. What is difference between Swing and JSF?
62. Why does JComponent class have add() and remove() methods but Component class does not?
63. What method is used to specify a container's layout?
64. What is the difference between AWT and SWT?
65. What is the difference between JFC & WFC?
66. What is a convertor?
67. What is the difference between a Canvas and a Scroll Pane?
68. What is the purpose of the enableEvents() method?
69. What is the difference between a MenuItem and a CheckboxMenuItem?
70. Which is the super class of all event classes?
77. How the Canvas class and the Graphics class are related?
71. What is the difference between a Window and a Frame?
72. What is the relationship between clipping and repainting?
73. What advantage do Java's layout managers provide over traditional windowing systems?
74. When should the method invokeLater() be used?
75. What is the difference between choice and the List ?
76. What is the relationship between the Canvas class and the Graphics Class?
77. How are the elements of a borderLayout organized?
78. How are the elements of a GridBagLayout organized?
79. Difference between paint() and paintComponent()?
80. Give us the Name of the List LayoutManagers in Java?
81. Can a class be it’s own event handler? Explain how to implement this?
82. How would you create a button with rounded edges?
83. What is the difference between the ‘Font’ and ‘FontMetrics’ class?
84. What class is at the top of the AWT event hierarchy?
85. Explain how to render an HTML page using only Swing?
86. How would you detect a keypress in a JComboBox?
87. Why should the implementation of any Swing callback (like a listener) execute quickly?
88. In what context should the value of Swing components be updated directly?
89. Why would you use SwingUtilities.invokeAndWait or SwingUtilities.invokeLater If your UI seems to freeze p Which Swing methods are thread-safe?
90. Which Swing methods are thread-safe?
More JAVA Swings Interview Questions : Click Here
1. What is Java Swing?
2. What is JFC?
3. What is AWT?
4. What are the differences between Swing and AWT?
5. What are heavy weight components ?
6. What is lightweight component?
7. What is double buffering ?
8. What is an event in Swing?
9.What is an event handler in swing?
10. What is a layout manager?
11. What is clipping?
12. Which containers use a border Layout as their default layout in swing?
13. What is the preferred size of a component?
14. What method is used to specify a container's layout?
15. Which containers use a FlowLayout as their default layout?
16. Which method of the Component class is used to set the position and size of a component?
17. What is the What is the difference between invokeAndWait() and invokeLater()? ?
18. Why should any swing call back implementation execute quickly?
19. What is an applet?
20. What is the difference between applications and applets?
21. Which method is used by the applet to recognize the height and width?
22. When we should go for codebase in applet?
23. What is the lifecycle of an applet?
24. Which method is used for setting security in applets?
25. What is an event and what are the models available for event handling?
26. What are the advantages of the event-delegation model over the event-inheritance model?
27. Can a class be it's own event handler? Explain how to implement this?
28. Why does JComponent have add() and remove() methods but Component does not?
29. How would you create a button with rounded edges?
30. What is the difference between the "Font" and "FontMetrics" class?
31. What class is at the top of the AWT event hierarchy?
32. Explain how to render an HTML page using only Swing?
33. How would you detect a keypress in a JComboBox?
34. Why should the implementation of any Swing callback (like a listener) execute quickly?
35. If your UI seems to freeze periodically, what might be a likely reason?
36. Which Swing methods are thread-safe?
37. Why won't the JVM terminate when I close all the application windows?
38. What is an event?
39. What is an event handler ?
40. Which containers use a border Layout as their default layout?
41. What is source and listener ?
42. What is controls and what are different types of controls in AWT?
43. What is the difference between choice and list?
44. What is the difference between scrollbar and scrollpane?
45. What is a layout manager and what are different types of layout managers available?
46. How are the elements of different layouts organized?
47. What are types of applets?
48.What are the restrictions imposed by a Security Manager on Applets?
49. What is the difference between the Font and FontMetrics classes?
50. What is the relationship between an event-listener interface and an event-adapter class?
51. How can a GUI component handle its own events?
52. What is the difference between the paint() and repaint() methods?
53. What interface is extended by AWT event listeners?
54. What is Canvas ?
55. What is default Look-and-Feel of a Swing Component?
56. What are the features of JFC?
57. What does x mean in javax.swing?
58. What are invisible components?
59. What is the default layout for a ContentPane in JFC?
60. What does Realized mean?
61. What is difference between Swing and JSF?
62. Why does JComponent class have add() and remove() methods but Component class does not?
63. What method is used to specify a container's layout?
64. What is the difference between AWT and SWT?
65. What is the difference between JFC & WFC?
66. What is a convertor?
67. What is the difference between a Canvas and a Scroll Pane?
68. What is the purpose of the enableEvents() method?
69. What is the difference between a MenuItem and a CheckboxMenuItem?
70. Which is the super class of all event classes?
77. How the Canvas class and the Graphics class are related?
71. What is the difference between a Window and a Frame?
72. What is the relationship between clipping and repainting?
73. What advantage do Java's layout managers provide over traditional windowing systems?
74. When should the method invokeLater() be used?
75. What is the difference between choice and the List ?
76. What is the relationship between the Canvas class and the Graphics Class?
77. How are the elements of a borderLayout organized?
78. How are the elements of a GridBagLayout organized?
79. Difference between paint() and paintComponent()?
80. Give us the Name of the List LayoutManagers in Java?
81. Can a class be it’s own event handler? Explain how to implement this?
82. How would you create a button with rounded edges?
83. What is the difference between the ‘Font’ and ‘FontMetrics’ class?
84. What class is at the top of the AWT event hierarchy?
85. Explain how to render an HTML page using only Swing?
86. How would you detect a keypress in a JComboBox?
87. Why should the implementation of any Swing callback (like a listener) execute quickly?
88. In what context should the value of Swing components be updated directly?
89. Why would you use SwingUtilities.invokeAndWait or SwingUtilities.invokeLater If your UI seems to freeze p Which Swing methods are thread-safe?
90. Which Swing methods are thread-safe?
More JAVA Swings Interview Questions : Click Here