GridPanel - layout affects their position shape and size-public GridPanel setLayout(new GridLayout(2 3 setBackground(Color.green JButton b1 = new

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

View Full Document Right Arrow Icon
//******************************************************************** // GridPanel.java Authors: Lewis/Loftus // // Solution to Programming Project 9.1 // // Represents the panel in the LayoutDemo program that demonstrates // the grid layout manager. //******************************************************************** / import java.awt.*; import javax.swing.*; i public class GridPanel extends JPanel { //----------------------------------------------------------------- // Sets up this panel with some buttons to show how grid
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // layout affects their position, shape, and size. //-----------------------------------------------------------------public GridPanel() { setLayout (new GridLayout (2, 3)); setBackground (Color.green); JButton b1 = new JButton ("BUTTON 1"); JButton b2 = new JButton ("BUTTON 2"); JButton b3 = new JButton ("BUTTON 3"); JButton b4 = new JButton ("BUTTON 4"); JButton b5 = new JButton ("BUTTON 5"); add (b1); add (b2); add (b3); add (b4); add (b5); } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online