Java graphic application, JAVA Programming

I need to draw cars and trucks and background with road and a house with sky.

I have to use Vehicle class as a parent class. To draw pictures, i should draw fun things coming up with different drawings. the problem is that it is a "hard code".

I need to create a car class and a truck class as a children of Vehicle class.

the following UML classes shows the required elements in each class:

Vehicle class contains:



-color: Color

+Vehicle(in x:int, in y:int, in c:Color)

>>> Vehicle class to represent an automobile. there are 2 types of automobile: "car" and "truck". the draw method uses these values to draw the corresponding object.

>>> the draw() method is responsible of all the drawings of the Vehicles. it contains all the logic for drawing.

Car Class Contains:

-doors: int

+draw(in g:Graphics)

+Car(in x: int, in y: int, in c c:Color, in d: int)


>>> the move() methods move the car across the screen. it simply update the position of the car.

Truck Class Contains:

-type: string


+draw(in g: Graphics)

+Truck(in x: int, in y: int, in c:Color, in type: string)

DrawPanel Class Contains:

+paintComponent(in g: Graphics)

>>> the drawpanel class should contain Timer object that is responsible of making things move of all Vehicles that i create.

TestDraw class contains nothing its only runs the classes.

Posted Date: 2/21/2013 5:36:53 AM | Location : United States

Related Discussions:- Java graphic application, Assignment Help, Ask Question on Java graphic application, Get Answer, Expert's Help, Java graphic application Discussions

Write discussion on Java graphic application
Your posts are moderated
Related Questions
#include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; int numtraps; main( ) { void input( void );

What is Color in AWT? Color is a class in the AWT. Individual colors such as red or mauve are examples of this class, java.awt.Color. Be sure to import it if you want to use ot

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

What is the Comparable interface? Comparable interface is used to sort arrays and collections of objects using collections.sort() and java.utils. Objects of the class implement

differende between action listener and event listener

Question 3 Using this line: var posneg : array [1..15] of integer; Write a program that calculates the number of negative and positive numbers in the array. Users will

Write a quality and complexity analysis report, JAVA Programming

For this assignment we will be solving the producer-consumer problem with a bounded buffer. You are required to implement this assignment in Java. There are three components in thi

What is Inheritance in java Explain with example? Code reusability is claimed to be a key advantage of object-oriented languages over non-object-oriented languages. Inheritance