[go: up one dir, main page]

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

AJP MICROPROJECT

MICROPROJECT
Puzzle Game
USING
Advanced Java Language
Holkar Kalyani Suryakant (43)
Semester of
Diploma in
(Computer Engineering) of
Maharashtra Education Board Of Technical
Education Mumbai.
Under Guidance
Prof.R.V.Bhondage.

pg. 1
AJP MICROPROJECT

CERTIFICATE

“Puzzle Game”
This is to certify that the project Of
report entitled.

In the Benefield work and it is summited


to the
Maharashtra state board of
Technical education Mumbai. By
Holkar Kalyani (43)
5th semester of diploma in

Computer engineering Maharashtra State


board of technical education Mumbai .

pg. 2
AJP MICROPROJECT

INDEX

1. Acknowledgement
2. INTRODUCTION
3. AIM
4. OBJECTIVE
5. STEPS
6. ADVANTAGES
7. DISADVANAGES
8. Steps to play game
9. SOURCE CODE

10.OUTPUT
11.SKILL
DEVELOPED

pg. 3
AJP MICROPROJECT

❖ Acknowledgement

It is to Pride present micro project report on “Puzzle Game” with


the deep sense of gratitude and profound respect;
I am thankful to my guide Prof.Rohinee Bhondage for the
valuable guidance and teaching skill which gives us more
knowledge.
Our sincere and whole hearted thanks to Prof.P.J.Bansode ,HOD,
Computer Engineering , For providing all facilities needed for
successful completion of project.
We are also thankful to Principal Dr.S.L.Andhare for inspiring us
to achieve highest goal. Last but not the least; I am thankful to my
parents ,all faculty members and friends who have directly and
indirectly help me in completing my project.
Thank You!!

Name of Student :
Holkar Kalyani.

pg. 4
AJP MICROPROJECT

❖ Introduction :

In This microproject we are going to study about “Puzzle


Game” using advanced java. Advanced java is special
type of program that is object-oriented .This allows us to
create modular programs and reusable code. Here we are
using label ,button ,ActionListener to make Puzzle

❖ Aim :

Apply knowledge of Advanced java to develop Puzzle Game.

❖ Objective :

To develop Puzzle Game.

❖ Literature review :

o In this microproject we use Eclipse. o


Using Label ,Button ,and other label.

pg. 5
AJP MICROPROJECT

❖ Steps :

1. Open Eclipse.
2. Choose the new project.
3. Name the Project. ...
4. Make a New Class. ...
5. Import java.awt package ...
6. Extends frame. ...
7. Make create button ,label and other label . ...
8. Save the program.
9. Run Program 10. Output.

pg. 6
AJP MICROPROJECT

❖ Advantages :

1. Java is Object-Oriented and a general-purpose programming language that


helps to create programs and application on any platform.
2. We can also handle exceptions through the java code.
3. Java is simple language.
4. Java is cheap and economical to maintain
5. Java is platform-independent.
6. Java is high-level programming language.

❖ Disadvantage :

1. Java is slow and has a poor performance.


2. Java provides not so attractive look and feels of the GUI.
3. Java provides no backup facility.
4. Java requires significant memory space. 5. Complex code.

pg. 7
AJP MICROPROJECT

❖ Steps to play Game

1. Run the code


2. Click on the icon
3. Drag and Drop it
4. Till do it to get all numbers in sequence.
5.When all numbers get in sequence, congratulation
message display on screen

pg. 8
AJP MICROPROJECT

❖ Source code :

package awtpackage;

import java.awt.*; import


java.awt.event.*; import
javax.swing.JOptionPane; public
class Puzzle1 extends Frame
implements ActionListener{
Button
b1,b2,b3,b4,b5,b6,b7,b8,b9;
Puzzle1(){ super("Puzzle1 -
JavaTpoint"); b1=new
Button("1");
b1.setBounds(50,100,40,40);
b2=new Button("2");
b2.setBounds(100,100,40,40);
b3=new Button("3");
b3.setBounds(150,100,40,40);
b4=new Button("4");
b4.setBounds(50,150,40,40);
b5=new Button("5");

pg. 9
AJP MICROPROJECT

b5.setBounds(100,150,40,40);
b6=new Button("6");
b6.setBounds(150,150,40,40);
b7=new Button("7");
b7.setBounds(50,200,40,40);
b8=new Button("");
b8.setBounds(100,200,40,40);
b9=new Button("8");
b9.setBounds(150,200,40,40);

b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
b6.addActionListener(this);
b7.addActionListener(this);
b8.addActionListener(this);
b9.addActionListener(this);

add(b1);add(b2);add(b3);add(b4)
;

pg. 10
AJP MICROPROJECT

add(b5);add(b6);add(b7);add(b8)
; add(b9);
setSize(400,400);
setLayout(null);
setVisible(true);
}
public void
actionPerformed(ActionEvent
e){ if(e.getSource()==b1){
String label=b1.getLabel();
if(b2.getLabel().equals("")){
b2.setLabel(label);
b1.setLabel("");
}
if(b4.getLabel().equals("")){
b4.setLabel(label);
b1.setLabel("");
}
}
if(e.getSource()==b2){
String label=b2.getLabel();
if(b1.getLabel().equals("")){
b1.setLabel(label);
b2.setLabel("");

pg. 11
AJP MICROPROJECT

}
if(b3.getLabel().equals("")){
b3.setLabel(label);
b2.setLabel("");
}
if(b5.getLabel().equals("")){
b5.setLabel(label);
b2.setLabel("");
}
}
if(e.getSource()==b3){
String label=b3.getLabel();
if(b2.getLabel().equals("")){
b2.setLabel(label);
b3.setLabel("");
}
if(b6.getLabel().equals("")){
b6.setLabel(label);
b3.setLabel("");
}
}
if(e.getSource()==b4){
String label=b4.getLabel();

pg. 12
AJP MICROPROJECT

if(b1.getLabel().equals("")){
b1.setLabel(label); b4.setLabel("");
}
if(b7.getLabel().equals("")){
b7.setLabel(label);
b4.setLabel("");
}
if(b5.getLabel().equals("")){
b5.setLabel(label);
b4.setLabel("");
}
}
if(e.getSource()==b5){
String label=b5.getLabel();
if(b2.getLabel().equals("")){
b2.setLabel(label);
b5.setLabel("");
}
if(b6.getLabel().equals("")){
b6.setLabel(label);
b5.setLabel("");
}
if(b4.getLabel().equals(""))

pg. 13
AJP MICROPROJECT

{
b4.setLabel(label);
b5.setLabel("");
}
if(b8.getLabel().equals("")){
b8.setLabel(label);
b5.setLabel("");
}
}
if(e.getSource()==b6){
String label=b6.getLabel();
if(b9.getLabel().equals("")){
b9.setLabel(label);
b6.setLabel("");
}
if(b3.getLabel().equals("")){
b3.setLabel(label);
b6.setLabel("");
}
if(b5.getLabel().equals("")){
b5.setLabel(label);
b6.setLabel("");
}

pg. 14
AJP MICROPROJECT

}
if(e.getSource()==b7){
String label=b7.getLabel();
if(b4.getLabel().equals("")){
b4.setLabel(label);
b7.setLabel("");
}
if(b8.getLabel().equals("")){
b8.setLabel(label);
b7.setLabel("");
}
}
if(e.getSource()==b8){
String label=b8.getLabel();
if(b9.getLabel().equals("")){
b9.setLabel(label);
b8.setLabel("");
}
if(b7.getLabel().equals("")){
b7.setLabel(label);
b8.setLabel("");
}

pg. 15
AJP MICROPROJECT

if(b5.getLabel().equals("")){
b5.setLabel(label);
b8.setLabel("");
}
}
if(e.getSource()==b9){
String label=b9.getLabel();
if(b6.getLabel().equals("")){
b6.setLabel(label);
b9.setLabel("");
}
if(b8.getLabel().equals("")){
b8.setLabel(label);
b9.setLabel("");
}
}

if(b1.getLabel().equals("1")&&b
2.getLabel().equals("2")&&b3.ge
tLabel()

pg. 16
AJP MICROPROJECT

.equals("3")&&b4.getLabel().equ
als("4")&&b5.getLabel().equals(
"5")
&&b6.getLabel().equals("6")&&
b7.getLabel().equals("7")&&b8.g
etLabel()

.equals("8")&&b9.getLabel().equ

als("")){

JOptionPane.showMessageDialo
g(this,"Congratulations! You won.");
}
} public static void main(String[]
args) { new
Puzzle1();
} }

pg. 17
AJP MICROPROJECT

❖ Output :

Before playing game After playing game

pg. 18
AJP MICROPROJECT

❖ Code run on eclipse :

pg. 19
AJP MICROPROJECT

pg. 20
AJP MICROPROJECT

pg. 21
AJP MICROPROJECT

❖ Skill developed

This microproject is a very interesting and knowledge giving project

very profit full. This project on “Puzzle Game”.

Programming skills are developed in this project.


We plays game from our childhood but making game using coding
is useful in our future to develop game or website.
Using Advanced java we can develop Structure ,data ,perform unit
testing ,etc .

pg. 22
AJP MICROPROJECT

❖ Conclusion :

Hence we learn how java program work with packages. In this


microproject we learnt about How we can create puzzle game usinf
different Labels

pg. 23

You might also like