Java I
Jonah Warrenjonah@parsons.edu
http://a.parsons.edu/~java2004
Lab 10
Code from class...
TextObjects.java
HelloWorld2.java
BasicEvents.java
MoreEvents.java
BasicDrawing.java
DrawApplet.java
HelloWorldObj.java
TestApplet.html
Homework 10
(Please email me if you have any questions or problems)- Read chapter 2 and chapter 8 from Sams Teach Yourself Java in 21 Days.
- Remember these two websites.
- http://java.sun.com/docs/books/tutorial/java/index.html - a tutorial site for Java basics and syntax.
- http://java.sun.com/j2se/1.4.2/docs/api/ - the Java API.
- Begin to think about a final project. You should have a very initial idea to talk about next class.
- Post the following 2 applets.
- Create an applet that is a custom drawing tool using the mouseDrag function.
- look at the drawing tools made with processing from week 7
- create a drawing with your drawing tool, take a screenshot and post it next to your program
- bonus if you can incorporate the sin function into your tool in an interesting way, or have the speed at which the user is drawing affect whats being drawn (scale, color, distortion).
- Make a creative typing tool using the font object. Make it so that everytime the user presses a key, that character appears on the screen in a different place. You will need to create a Letter object which has an x position, a y position, and the string containing the character of the letter pressed. Create a new object whenever a key is pressed. You will need to convert char to a String with String.valueOf(char c);. Some ideas to get your creative juices flowing:
- simple: character appears in a random position on the screen with a random size, and random color.
- more challenging: as you type, the characters transcribe a circle (use sin, cos).
- even more challenging: as you type, the characters transcribe a spiral (again use sin, cos).