Java AWT Question and Answers

1. What are AWT peers?
  A component is associated with a standard AWT button object, a peer object and an interfacing button object constructed per the native GUI.
 
Your Name Your Email-ID
Your Answer
2. What is the difference between a Swing and AWT components?
 
  • AWT components re heavy weight, whereas Swing components are lightweight.
  • Heavy weight components depend on the local windowing toolkit.
  • For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button.
 
Your Name Your Email-ID
Your Answer
3. What are the different types of controls in AWT?
  The AWT supports the following types of controls:
  • Labels, Pushbuttons, Checkboxes, Choice lists, Lists, Scroll bars, Text components
  • These controls are subclasses of component.
 
Your Name Your Email-ID
Your Answer
4. What are the benefits of Swing over AWT?
 
  • Swing components are light weight.
  • We can have a pluggable look and feel feature which shows us how they appear in other platforms.
  • We can add images to Swing components. We have toolbars and tooltips in Swing.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 1 of 10