Lecture28 - Java Programming, 3e Concepts and Techniques...

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

View Full Document Right Arrow Icon
Java Programming, 3e Concepts and Techniques Chapter 6 ICTN 2730 Lecture 28 03/28/2008 Creating Menus and Button Arrays Using the Abstract Windows Toolkit (III)
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Assignments Read chapter 6 and lecture notes. Homework 10 is due next Wednesday. Please read chapter 7 before starting the project. Check Tables 7-4 and 7-7. Homework 10 contains a bonus section. Do not miss the opportunity to improve your grade. Quiz 3, covering chapters 5 - 6 and lectures 19-28, will be available on Blackboard from 7 pm Sunday (3/30) till 9 pm Monday (3/31).
Background image of page 2
3 Calculator Application public class Calculator extends Frame implements ActionListener { public Calculator() { } public void actionPerformed(ActionEvent e) { } // end of actionPerformed public static void main(String args[]) { Calculator f = new Calculator(); } // end of main } // end of class
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 The main() Method Constructs an instance of Calculator Sets attributes with Frame methods
Background image of page 4
5 Searching the Numeric Buttons Test for button click Sequentially search the array If a match is found, use the case statements to determine the action One break statement can serve for multiple cases Set foundKey to true to avoid unnecessary looping To display a number with multiple digits, concatenate the result of the getLabel() method with the previous data in TextField
Background image of page 5

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

View Full DocumentRight Arrow Icon
6
Background image of page 6
7 Analyzing a statement lcd.setText(lcd.getText() +keys[i].getLabel());
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.

Page1 / 22

Lecture28 - Java Programming, 3e Concepts and Techniques...

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