Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m looking to do a program using a mp3 player. I\'m just advise on how ans whe

ID: 3919578 • Letter: I

Question

I'm looking to do a program using a mp3 player. I'm just advise on how ans where to start.

VIEW - Graphical User Interface Demonstration (Test Drive)

Submit the Java code that demonstrates your program's Graphical User Interface (look and feel).

You are not submitting a full running application. Only give me your GUI with some "test" data and the ability to click from screen-to-screen or select core aspects of functionality. I should be able to run the code and click through the interface even though it doesn't yet work as intended.

Program functionality is not expected to work. This part of the assignment is purely about letting me "test drive" your GUI.

Example: If you are writing an MP3 player you should have the major aspects of your GUI planned out and built but pressing play, pause, advance, etc might only print a message to the console that says "Play pressed" instead of actually playing music.

MODEL - Application Data Models

Submit the core Java classes that will be used to manage the data in your application

You are not submitting a functional application, only the classes for your application's core data models.

Example: If you are writing a To Do Application you might submit to me a ToDo class and a ToDo List class along with any other classes necessary to manage the data in your program.

What to Submit

Submit all items as requested above in a single zip folder. Please be sure to include any instructions necessary for me to build and review your application.

This assignment is different for other group and will be graded pass/fail. The goal of this assignment is for me to review your work and provide better feedback to your group as you complete your project.

Explanation / Answer

import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.filechooser.*;
import javax.swing.SwingUtilities;
import javax.media.*;
import java.io.File;
import java.net.URL;
import javax.media.Manager;
import javax.media.Player;
class audio extends JPanel implements ActionListener
{
JFrame frame;
JButton b1,b3;
JPanel p,p2;
JFrame f1;
JMenuBar mbar;
JMenu m1,m2;
JMenuItem ofile,exitfile,aboutus;
JFileChooser fc;
private Player audioplayer=null;
private File file;
public audio()
{
f1=new JFrame("Audio Player");
f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fc=new JFileChooser();
mbar=new JMenuBar();
mbar.setOpaque(true);
mbar.setBackground(new Color(154, 165, 127));
m1=new JMenu("File");
m2=new JMenu("Help");
mbar.add(m1);
mbar.add(m2);
ofile=new JMenuItem("Open");
ofile.addActionListener(new playing());
exitfile=new JMenuItem("Exit");
exitfile.addActionListener(this);
aboutus=new JMenuItem("AboutUs");
aboutus.addActionListener(this);
m1.add(ofile);
m1.addSeparator();
m1.add(exitfile);
m2.add(aboutus);
f1.setJMenuBar(mbar);
p=new JPanel();
p2=new JPanel();
p.setLayout(null);
p.setBackground(Color.blue);
p.add(p2).setBounds(0,0,350,60);
p2.setBackground(Color.darkGray);
f1.add(p);
b1=new JButton("Play");
b1.addActionListener(new playing());
b3=new JButton("Stop");
b3.setEnabled(false);
b3.addActionListener(this);
p2.add(b1);
p2.add(b3);
f1.setSize(350,110);
f1.setVisible(true);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==ofile)
{
int returnVal=fc.showOpenDialog(audio.this);
if(returnVal==JFileChooser.APPROVE_OPTION)
{
file=fc.getSelectedFile();
}
else
{
System.out.println("File Access Canceled by user");
}
}
if(evt.getSource()==b3)
{
audioplayer.stop();
b1.setEnabled(true);
b3.setEnabled(false);
}
if(evt.getSource()==exitfile)
{
System.exit(0);
}
if(evt.getSource()==aboutus)
{
JFrame af1=new JFrame("About Us");
af1.setVisible(true);
af1.setSize(350,200);
af1.setLocation(300,300);
JPanel ap1=new JPanel();
ap1.setBackground(Color.white);
af1.add(ap1);
JLabel l1=new JLabel("Developed by Ashish....",JLabel.CENTER);</p>
ap1.add(l1);
}
}
public void oplay()
{
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
int result=fc.showOpenDialog(this);
if(result==JFileChooser.CANCEL_OPTION)
file=null;
else
file=fc.getSelectedFile();
}
public void cplay()
{
if(file==null)
return;
try
{
audioplayer = Manager.createRealizedPlayer(file.toURI().toURL());
audioplayer.start();
}
catch(Exception xe)
{
JOptionPane.showMessageDialog(frame,"Invalid Files Types..","Error loading page",JOptionPane.ERROR_MESSAGE);</p>
}
}
public class playing implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
oplay();
cplay();
b1.setEnabled(false);
b3.setEnabled(true);
}
}
public static void main(String args[])
{
audio me = new audio();
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote