GUI3 - 94.204 Object-Oriented 94 204* Object Oriented...

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

View Full Document Right Arrow Icon
4 204* Object riented Software Development 94.204 Object-Oriented Software Development Part 18-c Building Graphic User Interfaces with Java rid Layout Grid Layout Handling events from multiple sources Copyright © 1998-2001 D.L. Bailey, Systems and Computer Engineering, Carleton University revised April 2002 Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18c-Gui3.ppt 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
he ridLayout ayout Manager The GridLayout Layout Manager • The GridLayout layout manager organizes a container's components in a rectangular grid • The container is divided into equal size rectangles, and one mponent is placed in each rectangle component is placed in each rectangle • Here’s how to build a panel that models a telephone keypad: Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18c-Gui3.ppt 2
Background image of page 2
ridLayout ayout Manager Example GridLayout Layout Manager Example public class Telephone extends JFrame { public static void main(String args[]) { JFrame f = new Telephone(); f.pack(); show(); f.show(); } Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18c-Gui3.ppt 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
ublic Telephone () public Telephone () { super(“Telephone”); JPanel p = new JPanel(); p.setLayout(new GridLayout(4,3)); p.set ayout( e G d ayout( ,3)); p.add(new JButton("1")); p.add(new JButton("2")); .add(new JButton("3")); p.add(new JButton( 3 )); p.add(new JButton("4"));
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

GUI3 - 94.204 Object-Oriented 94 204* Object Oriented...

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

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