Java Microproject Report
Java Microproject Report
______________________________________
Submitted by the group of ___ students,
Roll
Sr.
No Name Enrollment No Seat No
No
Certificate
This is to certify that Mr. / Ms. _______________________________________
Dhule (Institute Code: 0059) has completed the Micro Project satisfactorily in
Subject Data Structures Using ‘C’ (22317) in the academic year 2023-2024 as
Certificate
This is to certify that,
Roll No Enrollment No Name Exam Seat No.
Java uses statements of control the flow of execution of program based on certain
conditions. This are used to cause the flow of execution to book conditions. Person
will able to use switch case to check multiple conditions .
Platform freelance – several languages area unit compatible with only 1 platform.
Java was specifically designed in order that it might run on any laptop, regardless if it
had been running Windows, Linux, Mac, UNIX operating system or any of the
opposite software package.
Simple and simple to use – Java’s creators tried to style it therefore code can be
written with efficiency and simply. Java doesn't have some drawbacks. Since it's
automatic trash collection, it will tend to use additional memory than alternative
similar languages. There area unit typically implementation variations on completely
different platforms, that have LED to Java being delineated as a “write once , check
everywhere” system. Lastly, since it uses associate degree abstract “virtual machine”,
a generic java program doesn’t have access to native API’s on a system directry.
What is Applet?
An applications programme is dynamic and interactive java program that run
within the net page or applets ar tiny java programs that ar primarily utilized in net
computing. The java application programs run on prompt exploitation java interpreter
whereas the java applets will be transported over the web from one laptop to a
different and run exploitation the Appletviewer or any application program that
support java. AN applications programme is like program which may perform
arithmetic operations, show graphics, play sounds settle for user input, produce
animation and play interactive games. To run AN applications programme, it should
be enclosed in hypertext markup language tags for online page. application program
may be a program to look at online page. Java has enabled sites to make and use
absolutely hypermedia system net documents. an internet page will currently contain
not solely a straightforward text or a static image however additionally a Java
applications programme that, when run, will manufacture graphics, sounds and
moving pictures. thus java applications programme has created vital impact on World
Wide net. AN applications programme category extends from AWT Panel category,
that extend AWT instrumentation category, that extend AWT part category. AN
applications programme is largely a specialised panel that's embedded in an
exceedingly.
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
B. Program code
import java.applet.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Panel p;
Label display;
//Button
//Time
String disp;
boolean on;
//Initialization
//Initially off
on=false;
p=new Panel();
p.setLayout(new GridLayout(4,1,6,10));
hour=minute=second=millisecond=0;
//Label
disp="00:00:00:000";
display.setText(disp);
p.add(display);
//Start Button
start=new Button("Start");
start.addActionListener((ActionListener)this);
p.add(start);
//Reset Button
p.add(reset);
//Stop Button
stop=new Button("Stop");
stop.addActionListener((ActionListener)this);
p.add(stop);
add(p);
//Starting Thread
new Thread(this,"StopWatch").start();
//Reset Function
try{
Thread.sleep(1);
catch(Exception e){
System.out.println(e);
}
hour=minute=second=millisecond=0;
//Update function
millisecond++;
if(millisecond==1000) {
millisecond=0;
second++;
if(second==60)
second=0;
minute++;
if(minute==60)
minute=0;
hour++;
}
//Changing Label
if(hour<10)
disp="0"+hour+" : ";
else
disp=hour+" : ";
if(minute<10)
disp+="0"+minute+" : ";
else
disp+=minute+" : ";
if(second<10)
disp+="0"+second+" : ";
else
disp+=second+" : ";
if(millisecond<10)
disp+="00"+millisecond;
else if (millisecond<100)
disp+="0"+millisecond;
else
disp+=millisecond;
display.setText(disp);
//thread.run function
while(on)
try{
//pause 1 millisecond
Thread.sleep(1);
update();
//changeLabel
changeLabel();
catch(InterruptedException e){
System.out.println(e);
//actionPerformed
if(e.getSource()==start)
//stopwatch is on
on=true;
new Thread(this,"StopWatch").start();
}
//reset
if(e.getSource()==reset)
//stopwatch off
on=false;
reset();
changeLabel();
if(e.getSource()==stop)
//stopwatch off
on=false;}