IST240 Exam 2 Study Guide - IST240 Exam 2 Study Guide...

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

IST240 Exam 2 Study Guide - Chapter 5 o Define a class, instance variables public class Student{ o Write constructors public Student(){ o Know what the keyword this refers to the reason for using this construct [this] is that we have a situation that is known as name overloading - the same name being used for two different entities o Be able to write a toString method (that overrides methods inherited from Object class) public String toString(){ return ; - Chapter 6 o public class MainPanel extends JPanel o How do we get the GUI to do something when a button is clicked? rollButton.addActionListener(new ButtonListener()); private class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent evt) { if (evt.getSource() == rollButton) handleRollButton(); if (evt.getSource() == closeButton) System.exit(0); } } o How do you write the code to make a new JLabel (or JButton) with the
Image of page 1

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

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: caption “Greetings”? JLabel myLabel = new JLabel(“Greetings”); o Layout Managers: What do they do? You should be able to distinguish GridLayout, BorderLayout, FlowLayout. GridLayout - Organizes components into a grid of rows and columns BorderLayout - Organizes components into five areas (North, South, East, West, and Center) FlowLayout - Organizes components from left to right, starting new rows as necessary-Chapter 7 o Define an array of type t int scores = new int[10]; o Each array object has a public constant called length that stores the size of the array o It is referenced using the array name o scores.length o Note that length holds the number of elements, not the largest index o scores[2] = 45;-Chapter 8 o...
View Full 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