Gridlayoutrows int columns int creates a gridlayout

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t) Creates a GridLayout with a specified number of rows and columns. +GridLayout(rows: int, columns: int, Creates a GridLayout manager with a specified number of rows and hgap: int, vgap: int) columns, horizontal gap, and vertical gap. Rewrite the program in the preceding example using a GridLayout manager instead of a FlowLayout manager to display the labels and text fields. ShowGridLayout EE3206/EE5805 Java Programming & Applications Run 14 The BorderLayout The BorderLayout Manager The BorderLayout manager divides the container into five areas: East, South, BorderLayout West, North, and Center. Components are added to a BorderLayout by using Center. BorderLayout the add method. add(Component, constraint); constraint) where constraint is constraint BorderLayout.EAST BorderLayout.SOUTH BorderLayout.EAST, BorderLayout.SOUTH, BorderLayout.WEST BorderLayout.NORTH BorderLayout.WEST, BorderLayout.NORTH, or BorderLayout.CENTER BorderLayout.CENTER. The get and set methods for these data fields are provided in the class, but omitted in the UML diagram for brevity. The horizontal gap of this layout manager (default: 0). The vertical gap of this layout manager (default: 0). Creates a default BorderLayout manager. java.awt.BorderLayout -hgap: int -vgap: int +BorderLayout() +BorderLayout(hgap: int, vgap: int) Creates a BorderLayout manager with a specified number of horizontal gap, and vertical gap. EE3206/EE5805 Java Programming & Applications 15 BorderLayout BorderLayout Example ShowBorderLayout Run 16 EE3206/EE5805 Java Programming & Applications The Color The Co...
View Full Document

This note was uploaded on 04/20/2010 for the course ELECTRONIC EE3206 taught by Professor Tingchiwang during the Spring '10 term at École Normale Supérieure.

Ask a homework question - tutors are online