{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 22-GUI

Lecture 22-GUI - 16 Nov 2010 GUIS Graphical User Interfaces...

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

View Full Document Right Arrow Icon
1 1 16 Nov 2010 GUIS: Graphical User Interfaces Their mouse had a mean time between failure of … a week … it would jam up irreparably, or ... jam up on the table-- ... It had a flimsy cord whose wires would break. Steve Jobs: "... Xerox says it can't be built for < $400, I want a $10 mouse that will never fail and can be mass produced, because it's going to be the primary interface of the computer ..." ... Dean Hovey ... came back, "I've got some good and some bad news. Good news: we've got a new project with Apple. Bad news: I told Steve we'd design a mouse for 10 bucks." ... year later ... we … filed … and were granted a patent, on the electro- mechanical-optical mouse of today; ... we ended up ... [making] the mouse as invisible to people as it is today. R ead Chap. 17 of the text. ProgramLive CD: a better way to learn about GUIs. See CD for examples of code. Steve Sachs interview on 1 st computer with GUI: Apple Lisa (about $9,999 in 1982). http://library.stanford.edu/mac/primary/interviews/sachs/trans.html 2 JFrame’s content pane South East West Center North Container cp= getContentPane(); JButton jb= new JButton(“Click here”); JLabel jl= new JLabel( “label 2”); cp.add(jb, BorderLayout.EAST); cp.add(jl, BorderLayout.WEST); pack(); setVisible( true ); Layout manager : An instance controls the placement of components. JFrame layout manager default : BorderLayout. BorderLayout layout manager: Can place 5 components: JFrameDemo.java 3 Putting components in a JFrame import java.awt.*; import javax.swing.*; /** Demonstrate placement of components in a JFrame. Use BorderLayout. It places five components in the five possible areas: (1) a JButton in the east, (2) a JLabel in the west, (3) a JLabel in the south, (4) a JTextField in the north, and (5) a JTextArea in the center. */ public class ComponentExample extends JFrame {
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}