Note 12 for CMPSCI 121 at UMass
Note 12 for CMPSCI 121 at UMass
Popular in Course
Popular in Department
This 16 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Massachusetts taught by a professor in Fall. Since its upload, it has received 16 views.
Reviews for Note 12 for CMPSCI 121 at UMass
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
Lecture May 12 Graphics continued CMPSCI 121 Spring 2009 Introduction to Problem Solving with Computers Prof LearnedMiller Final Survey I Complete for extra credit I Find it under regular assignment location in OWL Logistics Final this Thursday May 14 1030am 2 hours long Location Mahar Auditorium 108 Special office hours today and tomorrow I announcement will be sent via email Covers the whole Ebook all lectures Review slides I Professor Smaragdakis slides I Check quotexam partquot of Class web page I Some material you are not responsible for However useful to read through I Please don39t email and ask if you are responsible for certain material Look in Ebook or at lecture slides Other review material I Midterm 1 I Midterm 2 I Understanding quotaliasingquot References to objects Casting Cat 0 new Cat Animal a c 0 Cat c2 Cat a quotActual classquot of an object I Material on interfaces Review in detail drawable example from class Graphics I What do I need to know about graphics on the exam I Review the snake program I How would you change which keys control the snake I How would you make the snake appear as ovals instead of squares I How would you change the color of one of the snakes 1 import javaawt 2 impart javaxswing 3 impart javaawtevent 4 5 public class Lccatar Extends JPancl implements chaeListener E int 33 7 String Incation quot B 9 Locatnrh 10 adnduseListencrtthisJ 11 1 12 13 public void paint ampnnentf raphics g 14 gdrawStringlocatinnxyi5 15 1 16 1 public void mouseClicked Hou5eEvcnt ei 13 x Bget j y egctT 19 locaticn quot x quot l y V 20 repaintl 21 22 23 public void mouseEnteredIchseEvcnt e 24 public void mauseExitelecuscEvent en 25 public void mousePressedIchseEvent e 26 public void mause cleasedt ouse vent ej 1 impcrt javaawt 2 impart javaxswiug 3 import javaawtevent q 5 public class Line licker attends JPanel implumants HnusaListaner 5 int Bldx 2 IntegerMINUALUE 7 int uld 2 IntegerHIHVELUE 3 int naw D 9 int new 2 D 11 11 public Lineclickarh 12 add cuseListenerIthis 13 14 public void paint cmponenti raphics g 15 gdrawLinecldE midi newx newTh 16 1 public vcid mmuge licked cuseEvent e 13 cldx HEWH aldf nevi 19 newx eget j new aget EU repaint 21 22 23 public vcid mnuseEntered HouseEvent ei 24 public void mausc xitedt uuse vent ei 25 public vcid mausePressedecuseEvent e 26 public vaid mmuse eleased nuse vent e ques on I How would we make sure that we don39t quotlosequot the work we39ve already done in the line segment painter 1 import javaawt 2 impart javaxswing 3 impart javaawtevent 4 5 public class DvalDrag extends JPanel implements HauseH tianListanEr E int x IntegerHIEVALUE T int y IntegerMINVALUE 3 9 public val ragj ID add nuse atianLiStenerfthisi 11 12 13 public void paintCumpDnenttcraphics g 14 gdraw valx y Z yf l yf4 15 IE 17 public vui mauseDraggedeouseEvent e 13 x aget3g 19 y egetYj 2D repaintl 21L 22 23 public void mause ovedt cuse vant ej 24 Snake mods 10 I a look back 11 You ve come a long way public class Greetings public static vuid main 3tring args System utprint cllo j Systemnutprint out 1 Systemuutprintquottherequotj 1 12 public class InfantTester public static vuid main String args Infant myKid 2 new InfantquotLizzie 4 int lizhge myKidgetAgel Systemoutprintln my kid39s name is myKidanotherMnnthj Systemmutprintln my kid is now I my idget am3 hhs 4 my idgethgell quot months 13 Where do go from here I 187 Data Structures I Starting more advanced concepts I Trees Hash tables Heaps Lists etc I CS minor I Majors I BS I BA fewer requirements not approved yet but will be soon 14 Congratulations 15
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'