Java Swing Question and Answers

17. What method is used to specify a container's layout?
 
  • The setLayout() method is used to specify a container's layout.
  • For example, setLayout(new Flow Layout()); will be set the layout as Flow Layout.
 
Your Name Your Email-ID
Your Answer
18. Which containers use a Flow Layout as their default layout?
  The Panel and Applet classes use the Flow Layout as their default layout.
 
Your Name Your Email-ID
Your Answer
19. Name Components subclasses that support painting?
 
  • The Canvas
  • Frame
  • Panel and
  • Applet classes support painting
 
Your Name Your Email-ID
Your Answer
20. What is the preferred size of a component?
  The preferred size of a component is the minimum component size that will allow the component to display normally.
 
Your Name Your Email-ID
Your Answer
123456789 Page 5 of 9