0% found this document useful (0 votes)
7 views

Adv Java Microproject

Uploaded by

2403fqcjkvyash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Adv Java Microproject

Uploaded by

2403fqcjkvyash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

A

Micro Project
on
Moving car using applet

Submitted in partial fulfillment of the requirement for the award of


Diploma of Engineering
in
Computer Engineering

22.Srushti Patil
23. Kusum Solanki
24.Kuashal Arekar
25. Suamitra Sawant

under the guidance of


MRS RUJUTA VARTAK

Department of Computer Engineering

2021-22
CERTIFICATE

VIVA COLLEGE OF DIPLOMA ENGINEERING & TECHNOLOGY


VIRAR (W) 2021-22
This is to certify that the micro project entitled “TCP-IP MODEL ” has been
submitted by under the guidance of Shweta Taral in partial fulfillment of the
requirement for the award of Diploma of Engineering in Computer Engineering from
Maharashtra State Board of Technical Education.

“MOVING CAR USING APPLET”


GROUP MEMBER

22. Srushti Patil


23. Kusum Solanki
24. Kuashal Arekar
25. Suamitra Sawant

Project Guide H.O.D


MRS. RUJUTA VARTAK PROF. NIKHILASOLKAR
INDEX

Sr. No. Name of the topic Page no.

PART –A PLAN

1 Brief Introduction 1

2 Aim of the Micro-Project 2

3 Action Plan 3

4 Resources Required 4

PART –B OUTCOMES

1 Brief Description 5

2 Aim of Micro-Project 6

3 Course Outcomes Integrated 6

4 Actual Procedure Followed 7

5 Actual Resources Used 8

6 Outputs of the Micro-Projects 9,10,11

7 Skill Developed/ learning out of this Micro-Project 11


Moving car using applet JPR 22412
SEM IV

PART-A PLAN
1.0 Brief Introduction

An applet is a Java program that can be embedded into a web page. It runs
inside the web browser and works at client side. An applet is embedded in an
HTML page using the APPLET or OBJECT tag and hosted on a web server.
Applets are used to make the website more dynamic and entertaining.

1
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

2.0 AIM of Micro-Project

Aim of this project is

• They are simple to make and they are supported by most web browsers.
• They are faster in nature.
• At the same time, the same Applet can work on "all" installed versions of Java.

2
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR
22412 SEM
IV

PART-B OUTCOME

1.0 Brief Description

A Java applet is a Java program that is launched from HTML and run in a
web browser.It takes code from server and run in a web browser.It can
provide web applications with interactive features that cannot be provided
by HTML. Since Java's bytecode is platform-independent, Java applets can
be executed by browsers running under many platforms, including
Windows, Unix, macOS, and Linux. When a Java technology-enabled web
browser processes a page that contains an applet, the applet's code is
transferred to the client's system and executed by the browser's Java
Virtual Machine (JVM).[5] An HTML page references an applet either via
the deprecated <applet> tag or via its replacement, the <object> tag.

3
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

2.0 AIM of Micro-Project

Aim of this project is

• They are simple to make and they are supported by most web browsers.
• They are faster in nature.
• At the same time, the same Applet can work on "all" installed versions of Java.

4
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

3.0 Course Outcomes (CO)

• Use an integrated development environment to write, compile, run, and test


simple object-oriented Java programs.

5
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

4.0 Actual Procedure Followed

➢ All applets are sub-classes (either directly or indirectly) of


java.applet.Applet class.
➢ Applets are not stand-alone programs. Instead, they run within either
a web browser or an applet viewer. JDK provides a standard applet
viewer tool called applet viewer.
➢ In general, execution of an applet does not begin at main() method.

6
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

6.0 Outputs of Micro-Projects

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class Car extends Applet implements ActionListener
{
int x, y, z;
int t1,t2;
Button b1, b2;
String msg=" ";
void slep()
{
try
{
Thread.sleep(100);
}
catch(Exception ex)
{

7
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

}
}
public void init()
{
t1=0;
t2=1;
x=20;
y=60;
setLayout(new FlowLayout(FlowLayout.CENTER));
Label l=new Label("webeduclick");
b1=new Button("Forward");
add(b1);
b2=new Button("Stop");
add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void start()
{
}

8
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

public void actionPerformed(ActionEvent e)


{
String s=e.getActionCommand();
if(s.equals("Forward"))
{
msg="Forward";
repaint();
}
else if(s.equals("Stop"))
{
msg=" ";
repaint();
}
}
public void paint(Graphics g)
{
setBackground(Color.black);
z=getWidth();
Color c1=new Color(20,160,200);
Color c2=new Color(200,60,200);

9
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

g.setColor(c1);
g.drawLine(0,y+75,z,y+75);
g.setColor(Color.red);
g.fillRoundRect(x,y+20,100,40,5,5);
g.fillArc(x+90,y+20,20,40,270,180);
g.setColor(Color.BLUE);
g.fillRoundRect(x+10,y,70,25,10,10);
g.setColor(Color.white);
g.fillRect(x+20,y+5,20,25);
g.fillRect(x+50,y+5,20,25);
g.setColor(Color.black);
g.fillRoundRect(x+55,y+10,10,20,10,10);
g.fillOval(x+10,y+50,25,25);
g.fillOval(x+60,y+50,25,25);
g.setColor(Color.white);
g.fillOval(x+15,y+55,10,10);
g.fillOval(x+65,y+55,10,10);
x=x+10;
slep();
if(msg.equals("Forward"))

10
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

{
if(x+120<z)
{
x=x+1;
showStatus("Press Forward for Starting Car");
repaint();
}
}
}
}

OUTPUT:-

11
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

12
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Moving car using applet JPR 22412
SEM IV

7.0 Skill Developed

Thus we have studied moving car using applet.

13
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.

You might also like