26.07.2013 Views

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 13 Graphical User Interface Components: Part 2 721<br />

Outline<br />

13.1 Introduction<br />

13.2 JTextArea<br />

13.3 Creating a Cus<strong>to</strong>mized Subclass of JPanel<br />

13.4 Creating a Self-Contained Subclass of JPanel<br />

13.5 JSlider<br />

13.6 Windows<br />

13.7 Designing <strong>Program</strong>s that Execute as Applets or Applications<br />

13.8 Using Menus with Frames<br />

13.9 Using JPopupMenus<br />

13.10 Pluggable Look-and-Feel<br />

13.11 Using JDesk<strong>to</strong>pPane and JInternalFrame<br />

13.12 Layout Managers<br />

13.13 BoxLayout Layout Manager<br />

13.14 CardLayout Layout Manager<br />

13.15 GridBagLayout Layout Manager<br />

13.16 GridBagConstraints Constants RELATIVE and REMAINDER<br />

13.17 (Optional Case Study) Thinking About Objects: Model-View-<br />

Controller<br />

13.18 (Optional) Discovering Design Patterns: Design Patterns Used in<br />

Packages java.awt and javax.swing<br />

13.18.1 Creational Design Patterns<br />

13.18.2 Structural Design Patterns<br />

13.18.3 Behavioral Design Patterns<br />

13.18.4 Conclusion<br />

Summary • Terminology • Self-Review Exercises • Answers <strong>to</strong> Self-Review Exercises • Exercises<br />

13.1 Introduction<br />

In this chapter, we continue our study of GUIs. We discuss more advanced components and<br />

layout managers and lay the groundwork for building complex GUIs.<br />

We begin our discussion with another text-based GUI component—JTextArea—<br />

which allows multiple lines of text <strong>to</strong> be displayed or input. We continue with two examples<br />

of cus<strong>to</strong>mizing class JPanel in which we discuss issues that relate <strong>to</strong> painting on Swing<br />

GUI components. Next, we illustrate how <strong>to</strong> design a <strong>Java</strong> program that can execute as both<br />

an applet and an application. An important aspect of any complete GUI is a system of<br />

menus that enable the user <strong>to</strong> effectively perform tasks in the program. The next two examples<br />

discuss how <strong>to</strong> create and use menus. The look-and-feel of a Swing GUI can be uniform<br />

across all platforms on which the <strong>Java</strong> program is executed, or the GUI can be

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

Saved successfully!

Ooh no, something went wrong!