Cover Page by Budi Kurniawan

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required