Sandy AJP Micro
Sandy AJP Micro
PROJECT REPORT
ON
TECHNOLOGY (2024-2025)
SHIVAJI POLYTECHNIC, ATPADI
CERTIFICATE
This is to certify that,
Of Class TY (Computer Technology) as per the curriculum laid down by the Maharashtra
State Board of Technical Education, Mumbai have successfully completed entitled
Under our guidance in satisfactory manner as a part of academic syllabus during the
academic year 2024-2025
Date:
Place: Atpadi
Last but not the least; I would like thank my family for supporting me spiritually
through out my life.
SR.NO TITLE
1. Introduction
2. Abstract
3. Code
4. Output
5. Conclusion
6. References
MUSIC PLAYER USING JAVA
INTRODUCTION
Java is a class-based, object-oriented programming language that is created to have as little execution
reliance as possible. It is a general-purpose programming language planned to let application developers
write once, and run anywhere (WORA), meaning that compiled Java code can run on all platforms that
support Java without the requirement for recompilation. Java applications are generally compiled to
bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer
architecture. The syntax of Java is identical to C and C++ but has fewer low-level facilities than either of
them. The Java runtime delivers dynamic abilities (such as reflection and runtime code modification) that
are generally not available in traditional compiled languages.
Java was initially developed by James Gosling at Sun Microsystems (which has since been accepted by
Oracle) and released in 1995 as a core component of Sun Microsystems' Java platform. The actual and
reference implementation of Java compilers, virtual machines, and class libraries were initially 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 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 source software utilized by most developers
and is the default JVM for almost all Linux distributions.
Music Player lets you control all your music files fast and easily. This audio player supports nearly all
kinds of mp3, midi,wav, FLAC raw aac files, and additional audio formats . Easily browse and play music
songs by genres, albums, artists, songs, and folders. Media is a crucial factor in our lives. We are making
a media player using java to handle all the music requirements of the user.
James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991.
Java was initially developed for interactive television, but it was too advanced for the digital cable
television industry at the time. The language was originally called Oak after an oak tree that stood outside
Gosling's office. Later the project went by the name Green and was eventually 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.
CODE
import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.advanced.AdvancedPlayer;
import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileInputStream;
import java.io.IOException;
public MusicPlayer()
{
setTitle("Java Music Player");
setSize(400, 200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLayout(new FlowLayout());
getContentPane().setBackground(new Color(60, 63, 65));
openButton = createStyledButton("Open", new Color(102, 205, 170));
playButton = createStyledButton("Play", new Color(135, 206, 235));
pauseButton = createStyledButton("Pause", new Color(255, 160, 122));
stopButton = createStyledButton("Stop", new Color(240, 128, 128));
playButton.setEnabled(false);
pauseButton.setEnabled(false);
stopButton.setEnabled(false);
add(openButton);
add(playButton);
add(pauseButton);
add(stopButton);
fileChooser = new JFileChooser();
openButton.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
int returnValue = fileChooser.showOpenDialog(null);
if (returnValue == JFileChooser.APPROVE_OPTION)
{
currentFile = fileChooser.getSelectedFile().getPath();
playButton.setEnabled(true);
pauseButton.setEnabled(false);
stopButton.setEnabled(false);
}
}
});
playButton.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
if (isPaused)
{
isPaused = false;
synchronized (playerThread)
{
playerThread.notify();
}
} else
{
playMusic(currentFile);
}
playButton.setEnabled(false);
pauseButton.setEnabled(true);
stopButton.setEnabled(true);
}
});
pauseButton.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
isPaused = true;
pauseButton.setEnabled(false);
playButton.setEnabled(true);
}
});
stopButton.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
stopMusic();
playButton.setEnabled(true);
pauseButton.setEnabled(false);
stopButton.setEnabled(false);
}
});
}
private JButton createStyledButton(String text, Color color)
{
JButton button = new JButton(text);
button.setBackground(color);
button.setForeground(Color.WHITE);
button.setFont(new Font("Arial", Font.BOLD, 14));
button.setFocusPainted(false);
button.setBorder(new LineBorder(Color.DARK_GRAY, 2));
button.setPreferredSize(new Dimension(80, 40));
button.setCursor(new Cursor(Cursor.HAND_CURSOR));
button.setToolTipText(text + " button");
button.addMouseListener(new java.awt.event.MouseAdapter()
{
public void mouseEntered(java.awt.event.MouseEvent evt)
{
button.setBackground(button.getBackground().darker());
}
public void mouseExited(java.awt.event.MouseEvent evt)
{
button.setBackground(color);
}
});
return button;
}
One of the most important benefits of Java is its capacity to move easily from one
computer system to another. The capability to run the same program on many
different systems is essential to World Wide Web software, and Java grows at this
1. "Java Programming" by E. Balagurusamy - If you're building your music player using Java, this
language of choice, this book can guide you through the coding concepts.
3. "Multimedia Systems" by Ralf Steinmetz and Klara Nahrstedt - This book discusses the theory