Skip to main content

Using Layout Managers

  • Chapter
Pro Java 8 Programming
  • 4271 Accesses

Abstract

In Java, you can use the java.awt.Container class and its subclasses to display groups of Swing components. For example, you might use a JPanel to display a related set of buttons or add components to a JFrame. Layout managers are classes that control the size and location of each component that’s added to a container, and in most cases a layout manager is also responsible for determining the sizes returned from the container’s getMinimumSize(), getPreferredSize(), and getMaximumSize() methods. Layout managers are important because they simplify the task of positioning and sizing components and because they allow you to create flexible user interfaces.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Brett Spell

About this chapter

Cite this chapter

Spell, B. (2015). Using Layout Managers. In: Pro Java 8 Programming. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0641-6_6

Download citation

Publish with us

Policies and ethics