Explanation/Screenshots

Drag to rearrange sections
Rich Text Content

I used many different concepts we have already familiarized ourselves with in class, such as JApplet, JPanel, the Graphics class, and ActionListeners, as well as inheritance and overriding methods.

The main CatApplet class extended the JApplet class, and the CatGraphicsPanel extended JPanel (demonstrating inheritance). I used the Graphics class in order to update the Cats' movements. ActionListeners were used for the buttons adjusting the force as well as for the Timer that ran in the CatGraphicsPanel that redraws the panel.

 

However, while I did expand on some of this previous knowledge, I also learned about completely new ideas, such as the Timer class and how to use it in the Graphics class to update the Panel.

Unlike earlier, when we were learning about the Graphics class and just drawing ovals and rectangles, I also needed to learn how to use this Graphics class to draw images onto the applet.

Also, although we learned the very simple basics on the different types of layouts for JApplets, this is the first time that I actually needed to figure out what the end result would look like once I finished placing the buttons, labels, and panels on the applet.

I was also unfamiliar with writing code that used images in the Graphics panel instead of simply drawing ovals or rectangles, and learned about BufferedImages, ImageIcons, and Images. Another small thing that I learned about was the major difference between swing and awt (mainly that awt is used with the Applet class, and swing with JApplet (a subclass of Applet)).

To me, the biggest challenge of this applet by far was how the three classes and the instances of these classes interacted, and what information and actions should be assigned to each class.

 

Below, you can see the different behaviors of the cats at force 5 and force 20.

rich_text    
Drag to rearrange sections
Image/File Upload
Untitled.png
attachment 26643594  
Drag to rearrange sections
Rich Text Content
rich_text    

Page Comments

Comments for this page are private. You can make comments, but only the portfolio's owner will be able to see them.

Add a New Comment:

You must be logged in to make comments on this page.