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:

-x:int

-y:int

-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)

+move()

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

Truck Class Contains:

-type: string

+move()

+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
Relate Java with C/C++ Very similar C/C++ syntax, operators, etc. Core language is simpler than C++ -- no pointers, no operator overloading, and no multiple inheritance.

The significant methods of ActionForm are: validate () & reset ().

We may use the java.net.URL and java.net.URLConnection classes to start a standard HTTP connection and "tunnel" to a Web server. The server then gives this information to the s

Write a program that manages a list of train tickets, JAVA Programming

design a payrol (non GUI)

Ask questionWrite a program BruteForceSearch that uses the brute-force approach given above and compare its running time on your computer with that of Binary Search for largeW.txt

How to write a program that converts US dollars into Canadian dollars.The program let the user enter an amount in US dollars and display it equivalent value in Canadian dollars whe

Java program will be take data from excel files (left diagram), and uses can be able to enter the input(middle diagram) in website when run the input the result appear in Pie 2D or

Introduction: In this project, you will explore a few sorting algorithms. You will also test their efficiency by both timing how long a given sorting operation takes and count

The different types of actions in Struts are: ? DispatchAction ? LookupDispatchAction ? ForwardAction ? SwitchAction ? IncludeAction