Chapter 4. Creating a view
This chapter covers
- A brief introduction to Swing
- The basics of a Griffon view
- Composing views with legacy source code
Views in Griffon are responsible for composing the visuals aspects of your application. Views are what the user interacts with. There are hundreds of components that you can use to create a view; and no matter which one you choose, you can compose the view in the same manner via a specialized DSL based on Groovy’s SwingBuilder.
Griffon views can also be composed of other views, resulting not just in clever reuse of code but also in a way to display new elements on the fly.
In this chapter, we’ll take a deeper look at Griffon views. We’ll start by examining a classic Swing example and then compare it to a Griffon example that implements the same functionality. After you’ve see how much easier Griffon is, we’ll look at special features of Griffon views and how you can use these features to keep your code organized when you build a large application. We’ll end this chapter by showing how you can integrate views built with NetBeans GUI builder (formerly Matisse) and Abeille Forms Designer into a Griffon application.