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.

Chapter 16Getting in the Swing of Things:Designing a GUI for BudgetProSometimes you gotta have a GUI; even we will admit that command lines <strong>on</strong>lygo so far. When it comes to simple interacti<strong>on</strong>s with casual users, a GraphicalUser Interface is a great step forward . . . if it’s d<strong>on</strong>e well. The toolkit forbuilding such an interface with Java is called Swing. The original Java toolkitis AWT (A Windowing Toolkit), and is still in use, but much less attractive.We’ll take a quick look at some major pieces of Swing, and show a completeexample—a GUI for our budget applicati<strong>on</strong>. After this example, you will havethe tools you need to c<strong>on</strong>struct some real GUIs <strong>on</strong> your own.16.1WHAT YOU WILL LEARN• The Swing GUI paradigm.• A simple standal<strong>on</strong>e Swing applicati<strong>on</strong>.• Some basic Swing objects—butt<strong>on</strong>s and labels.• A bit about layout managers.• A more complex object—the JTable.341

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

Saved successfully!

Ooh no, something went wrong!