Java Reference
In-Depth Information
model. This will be your biggest challenge. Go to it. It is a great way to learn.
Of course, you can also just download the complete SWT application from the
book Web site. 15
17.3.5
Completing the conversion of the BudgetPro class does not complete the
conversion of the entire application. The AcctDialog class must also be con-
verted. Use the same techniques we described here to convert that class as well.
(Or, again, just download the complete SWT application.)
Completing the Conversion of the Application
17.3.6
Our overall impression is that SWT is more easily comprehended in its entirety
than Swing. It may be easier to learn SWT first, since Swing's core model is
more complex but more powerful. But SWT and Swing weren't developed in
that order and Swing is still much more widely used. 16
For many GUI applications, our feeling is that it may be faster to write in
the SWT idiom. The problem lies in that SWT's model has limitations that
Swing's does not. Notably, SWT GUI elements are in a single rigid tree struc-
ture. It is not possible to have a factory class that constructs a GUI element
such as a dialog box which is passed up to the caller to be grafted into place on
a GUI. Instead, the parent element must be passed in, so all GUI elements be-
long to the single tree from the moment they are created. Also, by introducing
objects that cannot be garbage-collected, SWT brings into your application the
possibility of a class of bugs that Java otherwise eliminates.
Moreover, while converting a Swing application helped give this chapter
shape, we would, in general, prefer that an application be designed with its GUI
toolkit in mind. You would likely make slightly different design decisions
depending on which style of the GUI you choose.
Closing Thoughts
15. http://www.javalinuxbook.com/
16. A gut feel—not based on any real statistics.
Search WWH ::




Custom Search