Java Swing Question and Answers

1. What are differences between Swing and AWT?
  There is couple of differences between swing and AWT.
  • AWT component are considered to be heavyweight while Swing component are lightweights.
  • Swing has plug gable look and feel.
  • AWT is platform dependent same GUI will look different platform while Swing is developed in Java and is platform dependent.
 
Your Name Your Email-ID
Your Answer
2. Why Swing components are called lightweight component?
 
  • AWT component are associated with native screen resource and called heavyweight component.
  • While Swing components is uses the screen resource of an ancestor instead of having their own and that's why called lightweight or lighter component.
 
Your Name Your Email-ID
Your Answer
3. What is the difference between a scrollbar and a scrollpane?
 
  • A Scrollbar is just a component, but not a container.
  • A Scrolpane is a container.
  • A Scrollpane handles its own events and performs its own scrolling.
 
Your Name Your Email-ID
Your Answer
4. What is a container in a GUI?
  A container contains and arranges other components (including other container) through the use of layout managers, which use specific layout policies to determine where components should go as a function of the size of the container.
 
Your Name Your Email-ID
Your Answer
123456789 Page 1 of 9