Java graphic application, JAVA Programming

Assignment Help:

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.


Related Discussions:- Java graphic application

Explain traversing through a collector using iterator, Explain traversing t...

Explain traversing through a collector using Iterator. Ans. We can access each element in Collection by using Iterators regardless of how they are organized in collector. Ite

Explain why java does not support multiple inheritance, Question: (a) ...

Question: (a) Differentiate between the following terms using suitable examples of your own:- (i) inheritance v/s composition (ii) subclass v/s superclass (iii) softwa

School management, i need java program for account to hold payment of stude...

i need java program for account to hold payment of student

Inner, #question.Hi, i hope my message find you very well. could you help m...

#question.Hi, i hope my message find you very well. could you help me please with this question . provide an example code for an anonymous inner class. Highlight what makes your e

In javascript what is event handling and inline event, In JavaScript, what ...

In JavaScript, what is event handling? What are the two categories of events? In java script we could capture events on do a few operation on the basis of which particular even

Loop, write a program for loop

write a program for loop

Write a short note on image preloading process, Write a short note on image...

Write a short note on image preloading process? The primary use of image preloading procedure is to download the image within the cache before it is actually required to displa

Linked list, Write a program that takes as input a sequence of transactions...

Write a program that takes as input a sequence of transactions of the form "buy x; share(s) at $y each" or "sell x share(s) at $y each," assuming that the transactions occur on con

What is the comparable interface, What is the Comparable interface? Com...

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

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd