O'Reilly logo

Java 7: A Beginner's Tutorial (Third 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 is the second installment of the Swing topic and discusses techniques 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, the 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. A 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 for adding a layout manager. Since javax.swing.JComponent ...

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