Some views, such as graphical displays, may take some time to render. As a result,the view may fall behind update requests. Therefore, it is important to keep the viewin mind when coding the model. For example, the model could batch multiple updatesinto a single notification to the view.View instability vs. model stability
If constructed correctly, models can enjoy a fair degree of stability(owing to thestability of the domain model), whereas user interface code usually undergoesfrequent and sometimes dramatic change (typically because of usabilityproblems, the need to support growing classes of users, or simply the need tokeep the application looking "fresh"). Separating the view from the model makesthe model more robust, because the developer is less likely to "break" the model while reworking the view.
Attempting to join these two worlds in a hand coded method withoutarchitecture is very common, and results in the model object being polluted withknowledge of the interface, and vice-versa. This makes the code very inflexibleand difficult to maintain. For this reason (among others), many programmingshops develop the user interface design early in the process of design, and freezethe interface early. Swing Features and Concepts
The Java Swing Arhictecture
The Java Development Kit (JDK) contains a library of classes useful to softwareengineers – the Java Foundation Classes (JFC)Part of the JFC is the Swing package.
This section shows you all the Swing components and tells you how, in general, tocombine them to create a GUI. Swing provides many standard GUI components such asbuttons, lists, menus, and text areas. It also includes containers such as windows andtool bars.
to determine the size and position of the componentsthey contain. Borders affect the layout of Swing GUIs by making Swing componentslarger. You can also use invisible components to affect layout.
is how programs respond to external events, such as the user pressing amouse button. Swing programs perform all their painting and event handling in theevent-dispatching thread.
means drawing the component on-screen. Although it's easy to customize acomponent's painting, most programs don't do anything more complicated thancustomizing a component's border.
If you do something to a visible component that might affect or depend on its state, then you need to do it from the event-dispatching thread. This isn't an issue for many simpleprograms, which generally refer to components only in event-handling code. However,