Java GUI Designer Interview Questions

  1. What advantage do Java’s layout managers provide over traditional windowing systems? - Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java’s layout managers aren’t tied to absolute sizing and positioning, they are able to accomodate platform-specific differences among windowing systems.
  2. What is the difference between the paint() and repaint() methods? - The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.
  3. How can the Checkbox class be used to create a radio button? - By associating Checkbox objects with a CheckboxGroup
  5. What interface is extended by AWT event listeners? - All AWT event listeners extend the java.util.EventListener interface.
  6. What is a layout manager? - A layout manager is an object that is used to organize components in a container
  7. Which Component subclass is used for drawing and painting? - Canvas
  8. What are the problems faced by Java programmers who dont use layout managers? - Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system
  9. What is the difference between a Scrollbar and a ScrollPane? (Swing) - A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.