_4_Graphics_Layout - and add them to p1 Layout p111 p112...

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

View Full Document Right Arrow Icon
Layout How can we organize the display of graphical components?
Background image of page 1

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

View Full DocumentRight Arrow Icon
How to go from this to this
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
p1
Background image of page 4
p1 p11 p1 p12
Background image of page 5

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

View Full DocumentRight Arrow Icon
p1 p11 p12 p1 p11 p111 p112 p113
Background image of page 6
How?
Background image of page 7

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

View Full DocumentRight Arrow Icon
p1 getContentPane().add(p1); in myJFrame’s constructor you create a panel p1 and add it to myJFrame
Background image of page 8
p1 p11 p1 p12 add(p11); add(p12); in p1’s constructor you create 2 panels and add them to p1
Background image of page 9

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

View Full DocumentRight Arrow Icon
p1 p11 p12 p1 p11 p111 p112 p113 add(p111); add(p112); add(p113); in p11’s constructor you create 3 panels
Background image of page 10
Background image of page 11

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

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and add them to p1 Layout p111 p112 p113 setLayout(new GridLayout(rows,columns)); A method that can be applied to any panel Layout West Center East setLayout(new BorderLayout()); add(p1,North); North South A method that can be applied to any panel you have to tell where you want the new panel added See Examples on Angel on the folder lab5...
View Full Document

This note was uploaded on 03/17/2008 for the course IST 240 taught by Professor Tracymullen during the Spring '08 term at Pennsylvania State University, University Park.

Page1 / 13

_4_Graphics_Layout - and add them to p1 Layout p111 p112...

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

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