Grid layout & no layout

Grid layout & no layout - CSc 2700: Lecture # 8...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSc 2700: Lecture # 8 September 23, 2008 1 Grid Layout The GridLayout manager arranges the components in a table or grid of spec- i±ed dimensions, left to right, top to bottom, row by row. The constructors of GridLayout are: GridLayout(int rows, int cols) where rows and cols specify the number of rows and columns in the grid. GridLayout(int rows, int columns, int horizontalSpace, int verticalSpace) where rows and columns specify the number of rows and columns in the grid and horizontalSpace and verticalSpace are the horizontal and vertical gaps between components. GridLayout() creates a grid with one column for each component in a single row. Program # 1 uses GridLayout rather than FlowLayout to place 26 alphabet buttons in a frame 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Program 1. import java.awt.*; import javax.swing.*; import java.util.*; public class GridAlphabetButtons extends JFrame { public GridAlphabetButtons (int width, int height) // two argument constructor { // width and height are frame dimensions
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/06/2009 for the course CSC 2700 taught by Professor Duncan during the Spring '08 term at LSU.

Page1 / 5

Grid layout & no layout - CSc 2700: Lecture # 8...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online