0% found this document useful (0 votes)
18 views1 page

Cod in Java

The document defines a Java class that draws a truck using basic shapes like rectangles, ellipses and lines. The class overrides the paint method to draw the truck body as two rectangles, the wheels as ellipses and the base as a line. Text is also drawn on the truck bed.

Uploaded by

Medina Mesic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Cod in Java

The document defines a Java class that draws a truck using basic shapes like rectangles, ellipses and lines. The class overrides the paint method to draw the truck body as two rectangles, the wheels as ellipses and the base as a line. Text is also drawn on the truck bed.

Uploaded by

Medina Mesic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

import [Link].

*;
import [Link].*;
import [Link].*;

public class Kamion extends Applet


{ public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
[Link] rectangle =
new [Link](50,100,120,80);
[Link]([Link]);
[Link](rectangle);
[Link](rectangle);
[Link] rectangle1 =
new [Link](170,130,80,50);
[Link]([Link]);
[Link](rectangle1);
[Link](rectangle1);
[Link] backWheel =
new [Link](70,160,40,40);
[Link]([Link]);
[Link](backWheel);
[Link](backWheel);
[Link] frontWheel =
new [Link](190,160,40,40);
[Link]([Link]);
[Link](frontWheel);
[Link](frontWheel);
[Link] baseLine =
new [Link](0,200,800,200);
[Link](baseLine);

Font f = new Font("Serif", [Link], 25);


[Link](f);
[Link]([Link]);
[Link]("Mesic",66,124);
[Link]("Spedicija",66,148);

}
}

You might also like