Java Reference
In-Depth Information
Figure 16.4
BudgetPro GUI: viewing subaccounts
Finally, Figure 16.4 is a look at the main GUI window for BudgetPro once
several accounts have been constructed.
There is more to describe, but let's walk through the code that builds this
GUI and explain the parts as we go. The complete listing is available online at
http://www.javalinuxbook.com
. We'll make reference to the line numbers
of the listing in Appendix B, but sometimes we'll show excerpts of the code as
we go. You might find it handy to have a listing of the code (on paper or in
your browser) as you read the next several sections.
16.7.1
We divide the work between two GUI classes: one for the main window and
the other for the dialog that will appear when we want to create a new subac-
count. All of the other GUI elements will be either existing Swing classes or
their extensions as anonymous inner classes in our code. (More on those later.)
So that means that we have four of our own classes that we're working
with: two from the core of our application,
Account
and
User
, and two from
the GUI side of things,
BudgetPro
and
AcctDialog
. This will be reflected in
the package structure; we'll put
BudgetPro
and
AcctDialog
into the
net.multitool.gui
package. This will effect both the location of the source
Overview