0% found this document useful (0 votes)
16 views11 pages

Ajp 2

To Design a java program play music stored on machine and control it using various java components.

Uploaded by

Aryan Shinde
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)
16 views11 pages

Ajp 2

To Design a java program play music stored on machine and control it using various java components.

Uploaded by

Aryan Shinde
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/ 11

INDEX

Sr. No. Name of the topic Page no.

PART –A PLAN

1 Brief Introduction 1

2 Aim of the Micro-Project 1

3 Resources Required 2

P
AP
PART –B OUTCOME

1 Brief Description 3

2 Aim of Micro-Project
n 4
tio
3 Course Outcomes Integrated 4
lu

4 Actual Procedure Followed 5


So

5 Actual Resources Used 7

6 Outputs of the Micro-Projects 8


TE

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


SB
M
Music Player using Java AJP 22517 SEM V

PART-A PLAN
1.0 Brief Introduction

Java is a class-based, object-oriented programming language that is designed to have as


few implementation dependencies as possible. It is a general-purpose programming language
intended to let application developers write once, run anywhere (WORA), meaning
that compiled Java code can run on all platforms that support Java without the need for
recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual
machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar
to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides
dynamic capabilities (such as reflection and runtime code modification) that are typically not
available in traditional compiled languages.

P
AP
Java was originally developed by James Gosling at Sun Microsystems (which has since
been acquired by Oracle) and released in 1995 as a core component of Sun Microsystems' Java
platform. The original and reference implementation Java compilers, virtual machines, and class

n
libraries were originally released by Sun under proprietary licenses. As of May 2007, in compliance
tio
with the specifications of the Java Community Process, Sun had relicensed most of its Java
technologies under the GNU General Public License. Oracle offers its own HotSpot Java Virtual
Machine, however the official reference implementation is the OpenJDK JVM which is free open
lu

source software and used by most developers and is the default JVM for almost all Linux
So

distributions.

Music Player lets you manage all your music files quickly and easily . This audio
TE

player supports almost all types of mp3 , midi ,wav , flac raw aac files and other audio formats .
Easily browse and play music songs by genres , albums , artists , songs and folder.
Media is integral parts of our lives. We are creating media player using java to handle all the music
SB

requirements of user.

James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in
M

June 1991. Java was originally designed for interactive television, but it was too advanced for the digital
cable television industry at the time. The language was initially called Oak after an oak tree that stood
outside Gosling's office. Later the project went by the name Green and was finally renamed Java,
from Java coffee, the coffee from Indonesia. Gosling designed Java with a C/C++-style syntax that
system and application programmers would find familiar.

1
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Music Player using Java AJP 22517 SEM V

2.0 AIM of Micro-Project

To Design a java program play music stored on machine and control it using
various java components.

P
AP
n
tio
3.0 Resources Required
lu
So

Sr. No Name of Resource Specification Qty Remarks


TE

1 Computer 500GB HDD, 1


4 Gb RAM,
SB

AMD
processor,
Windows 7 OS
M

2
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Music Player using Java AJP 22517 SEM V

PART-B OUTCOME

1.0 Brief Description

Java is a class-based, object-oriented programming language that is designed to have as few


implementation dependencies as possible. It is a general-purpose programming language intended to
let application developers write once, run anywhere (WORA), meaning that compiled Java code can
run on all platforms that support Java without the need for recompilation. Java applications are
typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the
underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-

P
level facilities than either of them. The Java runtime provides dynamic capabilities (such as reflection

AP
and runtime code modification) that are typically not available in traditional compiled languages.

Java was originally developed by James Gosling at Sun Microsystems (which has since
been acquired by Oracle) and released in 1995 as a core component of Sun Microsystems' Java

n
platform. The original and reference implementation Java compilers, virtual machines, and class
tio
libraries were originally released by Sun under proprietary licenses. As of May 2007, in compliance
with the specifications of the Java Community Process, Sun had relicensed most of its Java
lu
technologies under the GNU General Public License. Oracle offers its own HotSpot Java Virtual
So

Machine, however the official reference implementation is the OpenJDK JVM which is free open
source software and used by most developers and is the default JVM for almost all Linux
distributions.
TE

Music Player lets you manage all your music files quickly and easily . This audio
player supports almost all types of mp3 , midi ,wav , flac raw aac files and other audio formats .
SB

Easily browse and play music songs by genres , albums , artists , songs and folder.
Media is integral parts of our lives. We are creating media player using java to handle all the music
requirements of user.
M

James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in
June 1991. Java was originally designed for interactive television, but it was too advanced for the digital
cable television industry at the time. The language was initially called Oak after an oak tree that stood
outside Gosling's office. Later the project went by the name Green and was finally renamed Java,
from Java coffee, the coffee from Indonesia. Gosling designed Java with a C/C++-style syntax that
system and application programmers would find familiar.

3
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Nuclear Energy EST 22447 SEM V

2.0 AIM of Micro-Project

To Design a java program play music stored on machine and control it using
various java components.

P
AP
3.0 Course Outcomes (CO)

n
tio
lu
1.Develop programs to handle events in Java Programming.
So

2.Develop programs using GUI Framework (AWT and Swing).


TE
SB
M

4
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Nuclear Energy EST 22447 SEM V

4.0 Actual Procedure Followed

Code:-
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;

P
import javazoom.jl.decoder.JavaLayerException;

AP
import javazoom.jl.player.Player;
import java.io.FileInputStream;
import java.io.IOException;

n
import java.util.function.Function; tio
public class layer {
lu
Player ;
So

BufferedInputStream bis;
FileInputStream fis;
File file;
TE

layer(){
JFrame main = new JFrame();
SB

main.setVisible(true);
main.setVisible(400,440);
main.setLayout(new FlowLayout());
M

main.setBackground(Color.MAGENTA);

JButton choose = new JButton("Choose Your Song");


choose.addActionListener
(
new ActionListener()
{
@Override
public void action Performed(ActionEvent actionEvent)
{
open_dialog();
}
}
);
5
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Nuclear Energy EST 22447 SEM V

main.add(choose);

JButton play = new JButton("Play");


play.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
try
{
player.play(100);
}
catch (Exception x){}
}
});
main.add(play);

P
JButton pause = new JButton("Pause");

AP
pause.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
try
{
n
tio
player.wait();
}
lu
catch (Exception x){}
}
So

});
main.add(pause);
TE
SB

main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}
M

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);
6
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Nuclear Energy EST 22447 SEM V

}
catch (Exception ec){}
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
public static void main(String[] args)
{
layer l = new layer();
}
}

P
AP
n
tio
lu
So
TE

5.0 Actual Resources Used


SB
M

Sr. No Name of Resource Specification Qty Remarks

1 Computer 500GB HDD, 1


4 Gb RAM,
AMD processor,
Windows 7 OS

7
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Nuclear Energy EST 22447 SEM V

6.0 Outputs of Micro-Projects

Output:

P
AP
n
tio
lu
So
TE
SB
M

8
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Nuclear Energy EST 22447 SEM V

P
AP
n
tio
lu
So
TE
SB
M

9
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER ENGG.
Nuclear Energy EST 22447 SEM V

7.0 Skill Developed


____________________________________________________
Thus we have build music player using Java and various GUI components.

P
AP
n
tio
lu
So
TE
SB
M

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

You might also like