Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Applet Coding4-12-2010Opening Discussion●What did we talk about last class?●Minute Essay comments–People positive toward Eclipse.●Down side is disincentive to learn code.–What is a kernel?Posting Our Applet●Last time we wrote a little applet and we also looked at the HTML-Documents directory where we can post things to the web.●We can start today by making a little web page and having that page display our applet.Applet Objective●I'd like for to write an “infinite notepad”. This will hit on many of the concepts we need to do other things.●You can type in lines of text that will appear near the middle of the screen.●Mouse drags will scroll around the view so you can see different strings.What We Need●Each string we enter needs the String along with an x and y position. We should create a separate class for those.●We will want a list of them to hold all the text that has been typed.●We need to keep integers for where we are currently looking.Listening for Events●One of the things that we have to do if we want to handle mouse or keyboard information in an applet (or a real Java application) is to listen for events.●In this case all the events effect the applet as a whole so we can just make the applet implement the different event listeners.●We will add those listeners in with a few lines of code in the init method because it needs to happen right at the beginning.Code●The logic for this program is mostly split between the listener methods and the paint method.Minute Essay●What questions do you have about what we did
View Full Document