O'Reilly logo

Java™: A Beginner's Tutorial, Second Edition by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Swinging Higher

In Chapter 15, "Swing Basics" you learned about the AWT and simple Swing components. This chapter now discusses topics that you invariably use in Swing programming: layout management and event handling. In addition, there is also discussion about menus, the look and feel, fast splash screens, Java system tray, and Java Desktop.

Layout Managers

A container, such as a JFrame and a JDialog, needs a java.awt.LayoutManager to lay out child components. The LayoutManager resizes and positions all child components, as well as rearranges the components when the container is resized. The java.awt.Container class has a setLayout method you use to add a layout manager. Since javax.swing.JComponent also extends the Container class, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required