GUI1 - SYSC 2004 Object Oriented SYSC-2004* Object-Oriented...

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

View Full Document Right Arrow Icon
YSC- 004* Object- riented Software SYSC 2004 Object Oriented Software Development Unit 20 Building Graphic User Interfaces with Java art 1 Part 1 evised October 2004 Revised October 2004 Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18-Gui1.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
Object Component Container Window JComponent Frame Panel JPanel Applet JFrame JApplet Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18-Gui1.ppt 9
Background image of page 2
xample reating a Frame Example - Creating a Frame import javax.swing.*; public class FrameExample1 { public static void main(String args[]) { JFrame f = new JFrame("Frame Example 1"); f. set Size(400, 300); f. set Visible(true); } } Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18-Gui1.ppt 10
Background image of page 3

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

View Full DocumentRight Arrow Icon
uilding GUI Programs : MVC Pattern Building GUI Programs : MVC Pattern General Principles Java Support Model The application Objects ie ook of GUI op late the JFrame View Look of GUI Populate the JFrame • Menus vs Content Panes idgets vs Direct Widgets vs Direct Drawing Controller Feel of GUI Java Event Model • Adding listeners to JComponent sources t i t t d Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18-Gui1.ppt 12 • Separate vs integrated
Background image of page 4
tructure of a Frame bject Structure of a JFrame object Title JFrame JRootPane JLayeredPane ptional menu bar optional menu bar content pane lass pane glass pane Adapted from Core Java 1.2, Volume 1 - Fundamentals, Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18-Gui1.ppt 13
Background image of page 5

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

View Full DocumentRight Arrow Icon
Frame JFrame Methods for manipulating these parts public Container get ContentPane() public Component getGlassPane() public JMenuBar get JMenuBar() public JLayeredPane getLayeredPane() public JRootPane getRootPane() public void set ContentPane(…) public void setGlassPane(…) public void set JMenuBar(…) public void setLayeredPane(…) public void setRootPane(…) Copyright © 2002, Systems and Computer Engineering, Carleton University. 94.204-18-Gui1.ppt 14
Background image of page 6
xample : A Simple Menu Example : A Simple Menu enuBar JMenu JMenuBar iew JMenuItem Controller View When you select a JMenuItem, you generate an event. he controller will listen for the event then print out the
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/16/2009 for the course SYSC 3303 taught by Professor Shramp during the Spring '09 term at Carleton CA.

Page1 / 20

GUI1 - SYSC 2004 Object Oriented SYSC-2004* Object-Oriented...

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

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