33.2. A Universal SQL Client

 
[Page 1007]

Chapter 30. MVC and Swing Models

Mayan God Shel, Mexico. Photographer: Philip Coblentz. Courtesy Brand X Pictures.

Objectives

  • To use the model-view-controller approach to separate data and logic from the presentation of data ( §30.2).

  • To implement the model-view-controller components using the JavaBeans event model ( §30.2).

  • To understand the Swing model-view-controller architecture ( §30.4).

  • To use JSpinner to scroll the next and previous values ( §30.5).

  • To create custom spinner models and editors ( §30.6).

  • To use JList to select single or multiple items in a list ( §30.7).

  • To add and remove items using ListModel and Default-ListModel ( §30.8).

  • To render list cells using a default or custom cell renderer ( §30.9).

  • To create custom combo box models and renderers ( §30.10).


[Page 1008]

30.1. Introduction

The Swing user interface components are implemented using variations of the MVC architecture . You have used simple Swing components without concern for their supporting models, but in order to use advanced Swing components, you have to use their models to store, access, and modify data. This chapter introduces the MVC architecture and Swing models. Specifically, you will learn how to use the models in JSpinner , JList , and JComboBox . The next chapter will introduce JTable and JTree .

 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net