Hitesh Ajp
Hitesh Ajp
This is to certify that Mr./Ms Hitesh patil Roll No:36 of Fifth Semester of
Diploma in Computer Engineering of Institute, LOKNETE GOPINATHJI
MUNDE INSTITUTE OF ENGINEERING
EDUCATION & RESEARCH ,NASHIK (Code: 1477) has completed the
Micro Project satisfactorily in Subject – Advanced Java Programming
(22517) for the academic year 2023- 2024 as prescribed in the curriculum.
Seal of institute
ANEEXURE II
Evaluation Sheet for the Micro Project
23 Hitesh patil
(Signature of Faculty)
2
WEEKLY PROGRESS REPORT
MICRO PROJECT
SR.NO. WEEK ACTIVITY PERFORMED DATE SIGN OF GUIDE
9 Compilation of Report
13th And Presentation
10 Seminar
14th
11 Viva voce
15th
3
INDEX
1 Acknowledgement 6
2 Introduction 7
3 Java Swing 8
4
ACKNOWLEDGEMENT
5
Introduction
6
Java Swing
Swing has about four times the number of User Interface [UI] components as
AWT and is part of the standard Java distribution. By today’s application
GUI requirements, AWT is a limited implementation, not quite capable of
providing the components required for developing complex GUI’s required in
modern commercial applications. The AWT component set has quite a few
bugs and really does take up a lot of system resources when compared to
equivalent Swing resources. Netscape introduced its Internet Foundation
Classes [IFC] library for use with Java. Its Classes became very popular with
programmers creating GUI’s for commercial applications.
7
Swing Hierarchy :
8
Working Of The Project
HOME PAGE:
In this music player we gives some number to the user then arrange the number
in proper format.
CREATION OF JFRAME:
This is the code where you will learn how to create the radio button, the
bookmark
button and the display of the application. You can set the foundation of the
widget
appearing, its location on the screen, its size etc.
HANDLING EVENTS:
This part of the code is responsible for your actions. Conditional statements
have
been used so as to act accordingly to the actions performed by the user
9
Source Code Of The Project
package jlay;
import
javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import
java.awt.event.ActionListener;
import java.io.BufferedInputStream;
import java.io.File;
import
javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;
import java.io.FileInputStream;
import java.io.IOException;
import
java.util.function.Function;
Player ;
BufferedInputStream
bis; FileInputStream fis;
File file; layer()
{
JFrame main = new JFrame();
main.setVisible(true);
main.setVisible(400,440);
main.setLayout(new FlowLayout());
main.setBackground(Color.MAGENTA);
JButton choose = new JButton("Choose Your Song");
choose.addActionListener
(
new ActionListener()
{
@Override
public void action Performed(ActionEvent actionEvent)
{
open_dialog();
}
}
);
main.add(choose);
JButton play = new JButton("Play");
play.addActionListener(new ActionListener() {
10
@Override
public void actionPerformed(ActionEvent actionEvent) {
try
11
{
player.play(100);
}
catch (Exception x){}
}
});
main.add(play);
JButton pause = new JButton("Pause");
pause.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
try
{
player.wait();
}
catch (Exception x){}
}
});
main.add(pause);
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
void open_dialog()
{
JFileChooser fc = new JFileChooser();
int result = fc.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION)
{
try {
file = new File(fc.getSelectedFile().getAbsolutePath());
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
try {
player = new javazoom.jl.player.Player(bis);
}
catch (Exception ec){}
}
catch(IOException e)
{
e.printStackTrace();
}}}
public static void main(String[] args)
{
layer l = new layer();
}}
12
Output Of The Project
Before playing
13
After playing
14
Conclusion & References
Conclusion :-
In this Project, we learned about how to create a form using AWT
components and also learned about Applet, Swing, Frame, Event
handling. Also we learned about validating the fields etc. Also we
study how to set questions and there answers in program.
References :-
https://www.jigsawacademy.com/blogs/tutorial/advanced-java
https://www.javatpoint.com/java-swing
https://www.edureka.co/blog/advanced-java-tutorial
14