Java AWT Question and Answers

13. Name Components subclasses that support painting?
 
  • The Canvas
  • Frame
  • Panel and
  • Applet classes support painting
 
Your Name Your Email-ID
Your Answer
14. What is the difference between a MenuItem and a CheckboxMenuItem?
 
  • The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.
 
Your Name Your Email-ID
Your Answer
15. How are the elements of different layouts organized?
 
  • FlowLayout: The elements of a FlowLayout are organized in a top to bottom, left to right fashion.
  • Border Layout: The elements of a BorderLayout are organized at the borders and the centre of a container.
  • CardLayout: The elements of a CardLayout are stacked, on the top of the other, like a deck of cards.
  • GridLayout: The elements of a GridLayout are equal size and are laid out using the square of a grid.
  • GridBagLayout: The elements of a GridBagLayout are organized according to a grid.
 
Your Name Your Email-ID
Your Answer
16. What is the default layout for Applet?
 
  • The default layout manager for an Applet is FlowLayout, and the FlowLayout manager attempts to honor the preferred size of any components.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 4 of 10