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

Info icon This 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)
Image of page 1

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

View Full Document Right 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).
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
Image of page 3

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

View Full Document Right Arrow Icon
4 The main() Method Constructs an instance of Calculator Sets attributes with Frame methods
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
Image of page 5

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

View Full Document Right Arrow Icon
6
Image of page 6
7 Analyzing a statement lcd.setText(lcd.getText() +keys[i].getLabel());
Image of page 7

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern