Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Eclipse/Applets11-11-2010Opening Discussion●Minute Essay comments–Do professors use RateMyProfessor? Is it real?–API for Eclipse?–Can you copy code from Greenfoot to Eclipse?Eclipse●We have been working in Greenfoot because it is good for learning. It is simple and doesn't provide too much help so you learn what you are doing.●Eclipse is a professional IDE (Integrated Development Environment). This is the type of tool real developers use. It is complex, but helps you program.●Netbeans is another professional IDE for Java.Applets●One of the reasons Java became so popular to start with was because of Applets. These are Java programs that you can put in web pages.●To make an applet we make a class that inherits from either java.applet.Applet or javax.swing.JApplet then add proper logic.Main Methods of Applets●void paint(Graphics g) - This method is called every time the applet is redrawn. Draw to the Graphics object much like a GreenfootImage.●void init() - Called when page first loaded.●void start() - Called every time you return to page.●void stop() - Called when you leave the page.●void destroy() - Called when the browser exits.Applications●You can also make Java programs that run on their own outside of a browser.●These require the main method.–public static void main(String[] args) { ... }●I have posted a class with a main method that will let you run your applet as an application.Applet Writing●Let's write an applet in Eclipse.●If we have time, we can see how we would put that up on a web page in the CS web space.Minute Essay●What do you see as advantages/disadvantages to an environment like
View Full Document