13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

350Chapter 16Getting in the Swing of Things: Designing a GUI for BudgetProFigure 16.4 BudgetPro GUI: viewing subaccountsFinally, Figure 16.4 is a look at the main GUI window for BudgetPro <strong>on</strong>ceseveral accounts have been c<strong>on</strong>structed.There is more to describe, but let’s walk through the code that builds thisGUI and explain the parts as we go. The complete listing is available <strong>on</strong>line athttp://www.javalinuxbook.com. We’ll make reference to the line numbersof the listing in Appendix B, but sometimes we’ll show excerpts of the code aswe go. You might find it handy to have a listing of the code (<strong>on</strong> paper or inyour browser) as you read the next several secti<strong>on</strong>s.16.7.1 OverviewWe divide the work between two GUI classes: <strong>on</strong>e for the main window andthe other for the dialog that will appear when we want to create a new subaccount.All of the other GUI elements will be either existing Swing classes ortheir extensi<strong>on</strong>s as an<strong>on</strong>ymous inner classes in our code. (More <strong>on</strong> those later.)So that means that we have four of our own classes that we’re workingwith: two from the core of our applicati<strong>on</strong>, Account and User, and two fromthe GUI side of things, BudgetPro and AcctDialog. This will be reflected inthe package structure; we’ll put BudgetPro and AcctDialog into thenet.multitool.gui package. This will effect both the locati<strong>on</strong> of the source

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!