Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC305 Lecture 08

CSC305 Lecture 08

Individual Software Design and Development
Connecting the Dots
(202410)

Javier Gonzalez-Sanchez

October 09, 2024
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 305 Individual Software Design and Development Lecture 08. Listeners
  2. 10

  3. 12

  4. 14

  5. 15

  6. 17

  7. MouseListener • public void mousePressed (MouseEvent e) {} • public

    void mouseClicked(MouseEvent e) { } • public void mouseRele a sed(MouseEvent e) { } • public void mouseEntered(MouseEvent e) { } • public void mouseExited(MouseEvent e) { } • public void mouseDr a gged(MouseEvent me) { } • public void mouseMoved(MouseEvent e) { } 18
  8. MouseMotionListener • public void mouseDr a gged(MouseEvent me) { }

    • public void mouseMoved(MouseEvent e) { } 19
  9. 21

  10. Let’s work Cre a te this GUI using J a

    v a : 1. Blue b a r a t the top with your n a me. 2. A grid a t the center. Use MouseListener to a llow the user to click on a squ a re a nd ch a nge the color to yellow 3. The f ive buttons on the bottom. Only “Cle a r" need to work. Ignore the others. 4. The gr a y-box over the grid with the sliders c a n be ignored. Do not a dd it a t this moment. 28
  11. CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D.

    [email protected] Summer 2024 Copyright. These slides can only be used as study material for the class CSC305 at Cal Poly. They cannot be distributed or used for another purpose.