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

Java Programming - Essay Example

Only on StudentShare
Masters
Author : ryleeorn
Essay
Technology
Pages 4 (1004 words)

Summary

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
Java Programming


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 Essays

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 loop continues until 'n' is typed indicating end of application.
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. 3. ShopKeeper class: This class gives the overall graphical user interface to the client so that the client can access both StockTake and Item classes in order to manipulate Items. This class uses some more user-defined classes to construct the GUI. The classes are:
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 programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that…
4 pages (1004 words)
Programming
A constructor is constructed by the class in case it is not written by the programmer. In this case time() is the default constructor which will be used in case time( int hh, int mm, int ss) is not used.…
9 pages (2259 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. Further we implement the interface ActionListener using the implements keyword. By interface we mean that we can specify what a class must do, but now how it does it. Here we have implemented the…
6 pages (1506 words)