StudentShare solutions
Got a tricky question? Receive an answer from students like you! Try us!

Essay example - Java Programming

Only on StudentShare
Pages 4 (1004 words)
The DrawWindow class in Java's element package is a very useful tool and a program is written to demonstrate its capability in animation. There are methods for using arcs, lines, rectangles, circles and other forms using these basic features. Also, colors can be included through the java.awt package.

Extract of sample

In the second screenshot, a loop has been created so that the car object drawn in the first task is repeatedly produced in a line. Also a rectangle is drawn to indicate the presence of road below the cars.
Since a composite object was required, I created a commom composite object of a car having a roof, a body and two wheels. I also added colors to it, formed efficiently many such objects and showed some animation.
I have learnt from this assignment of how useful the elements package is in creating graphics in the absence of applets. The shapes like rectangle, circles, etc are available through it for simple animations. I have also understood well of the co-ordinate values used in drawing objects. Some functions like timers are also learnt in this process.
The easiest part is creating a single composite object and also using it to create many. The tough part was in assigning the parameters of the moving objects and its color parameters for producing animation.
Download paper
Not exactly what you need?

Related papers

Java programs
The application then turns to user mode. It asks the number of tickets purchased. Based on the number entered it asks for the ticket numbers. Another file called 'UserFile.txt' is created that holds all the numbers entered by the user. The numbers are then checked against the winning number and appropriate results are announced. The application then asks if another user wants to try his own. The…
2 pages (502 words)
Java Program ShopKeeper
Some utility methods like getStockValue() and getNeededItems() are also there to return the over all value of the stock and the list of needed items respectively.…
4 pages (1004 words)
Systems Programming
If you have not completed the work by the due date please hand in whatever you have done.…
4 pages (1004 words)
Object Oriented Programming
OOP is an acronym for Object Oriented Programming. Traditionally, a computer program was seen as a collection of functions or procedures or simply a list of instructions whereas with the advent of Object Oriented programming, each program may be seen as comprising a collection of individual units, or objects, that act on each other. In simpler terms, it is a type of programming in which…
4 pages (1004 words)
Java Programming
Here we have used the access specifier as public which tells us that the class can be accessed anywhere in the program. In the same line we have used the concept of Inheritance, which is the process by which one object acquires the properties of another object. By the use of extends keyword we inherit all the functionality provided in the class JFrame, which is used to create a frame using Swings.…
6 pages (1506 words)