Java Swing Question and Answers

28. How do you classify Swing Components?
  Swing components are classified under the following headings:
    Top level containers – The containers at the top of any swing component hierarchy are:
  • Applet
  • Dialog
  • Frame
. General purpose containers – The intermediate containers are
  • Panel
  • Scroll pane
  • Split pane
  • Tabbed pane
  • Tool bar
Special purpose containers – These are intermediate containers which play specific roles in the user interface:
  • Internal frame
  • Layered pane
  • Root pane
Basic controls : The atomic components that exist primarily to get input from the user are
  • Buttons
  • Combo box
  • List
  • Menu
  • Slider
  • Spinner
  • TextField
Uneditable information displays: The atomic components which give information to the user are
  • Label
  • Progress bar
  • Tool tip
Interactive displays of highly formatted information – The atomic components that display formatted information that can be modified by the user are
  • Color chooser
  • File chooser
  • Table
  • Text
  • Tree
Your Name Your Email-ID
Your Answer
29. What is MVC?
  Model-View-Controller (MVC) is a well known object oriented design for GUI components. The architecture of swing components is based on MVC design. When a GUI component is developed using MVC architecture, it is divided into three parts:
  • Model-An object that defines the component's state
  • View-The visual screen representation of component.
  • Controller-An object that controls a component in such a way that it responds to user input.
  • The model part of an MVC-based component provides information that can be used to specify the component's value, provided the component has any value properties, e.g. the min and max values of a slider control are stored in the component's model part.
  • The Controller part modifies information maintained by the component's model part in response to input from the user.
  • The View part manages the way in which the object is drawn on the screen.
Your Name Your Email-ID
Your Answer
123456789 Page 8 of 9