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
Explain the term - Garbage Collection Java  performs  garbage  collection  and  eliminates  the  need  to  free  objects  explicitly.  When an object  has  no references   to

What is the difference between an if statement and a switch statement? The if statement is used to select between two alternatives. It uses a boolean expression to decide whi

Hospital Management System: Technology Used Java-JSP, Apache Tomcat (webserver), SQL SERVER 2000. This project is aimed at developing a web-based system for taking records

We want an E Commerce site Project Description: We want an E Commerce site like fifacointrader.. You must have experience with that kind of work We will award the proje

What are the types of Dependency Injection Spring supports? Ans) there are two types of Dependency Injection Spring a)  Setter Injection: b)  Constructor Injection:

Project Description: I want to build a camera application for android. By default android will add metadata for the image, for e.g.  Date, time, resolution, gps tag etc..In this

write a java program to board coloring

Java Programming 1. Write a program in Java to find the highest of any five numbers. How do you compile and execute this Java program? 2. Write a program to explain the Exce

Task - Defining a Student class The below illustration will explain how to write a class. We want to write a "Student" class which - should be able to store the below charac

Explain The Methods of java.lang.Object? java.lang.Object gives a number of methods that are general to all objects. toString() is the most general such method. Because the def