Section 12.5 Displaying Text and Images in a Window

• Class JFrame provides the basic attributes and behaviors of a window.

• A JLabel (p. 481) displays read-only text, an image, or both text and an image. Text in a JLabel normally uses sentence-style capitalization.

• Each GUI component must be attached to a container, such as a window created with a JFrame (p. 483).

• Many IDEs provide GUI design tools (p. 529) in which you can specify the exact size and location of a component by using the mouse; then the IDE will generate the GUI code for you.

JComponent method setToolTipText (p. 483) specifies the tool tip that’s displayed when the user positions the mouse cursor over a lightweight component (p. 480).

Container method add attaches a ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.