Java Long Question Q2 MVC Flashcards
Discuss three advantages of the MVC to software developers/
1) Ease of growth: Controller and views can grow as the model grows; and older versions of the views and controllers can still be used as long as a common interface is maintained.
2) Clarity of Design: By glancing at the models public method list, it should be easy to understand how to control the models behavior. When designing the application, this trait makes the entire program easier to implement and maintain.
3) Easier support for new types of clients: To support a new type of client, you simply write a view and controller for it and wire them into the existing Enterprise model.
Define the term pluggable look and feel.
Pluggable look and feel is a mechanism used in the Java Swing widget toolkit allowing to change the look and feel of the graphical user interface at runtime.
Describe the function of each of the following:
JOptionPane:
JScrollPane
JProgressBar
JOptionPane: It is used to create a JOptionPane with a test message. It is used to create an instance of JOptionPane to display a message.
JScrollPane:A JScrollPane provides a scrollable view of a component. When screen real estate is limited, use a scroll pane to display a component that is large or one whose size can change dynamically.
JProgessBar: The progress bar is a GUI control that informs the user how much (in percentage)
Discuss event handling model used in Java Swing .
Event Listener-
Event Handler-
Event Listener- is an object that subscribes for events from a source. Cf. the observer pattern. Usually you can have many listeners subscribing for each type of event
Event Handler- A handler is an object that is responsible for handling certain events
In other words, you usually have one handler for each type of event.