{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Java Programming, 3e Concepts and Techniques Chapter 7 Swing Interfaces with Sorting and Searching (V) ICTN 2730 Lecture 34 04/14/2008
Image of page 1

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

View Full Document Right Arrow Icon
2 Assignments Read chapter 7 and lecture notes. The week 14 bonus assignment is due Wednesday. Please consider doing it if you would like to improve your final grade. Please start early so you have time to go over the concepts from Chapters 1-7.
Image of page 2
3 The actionPerformed() Event Use getActionCommand() to retrieve the String assigned to a component that can have multiple states Use getSource() to retrieve the clicked object If the combo box was clicked, the index number is compared in a switch statement to specify the sort If Insert was clicked, enlargeArray() creates a new array to accommodate the new movie data New data is sent to each array, which is then sorted If Search was clicked, the field name and array are sent to the search() method
Image of page 3

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

View Full Document Right Arrow Icon
4 Coding the enlargeArray() Method Accepts an array and returns a new array that is one element longer The actionPerformed() method inserts the new data at the end of the new array
Image of page 4
5 Sorting an Array Bubblesort When a pair of elements is examined, the interchanged element moves to the top of the array Selection sort The array is searched for its lowest-value element, which is then positioned at the beginning of the array The process is repeated for each element, placing the elements in the next unsorted location Insertion sort
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
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