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

Please, create a program that contains a JFrame and a Database, using the follow

ID: 3727684 • Letter: P

Question

  



Please, create a program that contains a JFrame and a Database, using the following instructions. Please write it in computer. Project Objectives: To write a program that implements the following Advanced Programming concepts 1. Data encapsulation 2. Instantiate classes 3. Inheritance 4. Graphical User Interface concepts 5. Exception Handling 6. Inner classes 7. Database Project Name: Music Library The program will have the following private attributes: 1. UPC-unique identifier for CD's album (also called ASIN) 2. Album Name -album name 3. Artist artist full name 4. Album Image Name hold the CD image name 5. Genre music genre (salsa, rock, R&B;, etc.) 6. Release Date -release CD's date 7. Rank -CD's rank 8. Format media format (CD, LP, etc.) 9. Price- CD's price The project will display a splash screen then a login frame. If the user name and password are correct then will show the menu program. The program will have the following menu and menu items 1. File Add CD Album Modify CD Album Display CD Album CD Albums Report e ° o Exit 2. Help o Help Contents o About

Explanation / Answer

CODE

package gui;

import integration.MusicLib;

import integration.SearchList;

import integration.SearchOptions;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.*;

public class SearchWindow extends JFrame

{

private final MusicLib library;

private final LibraryMainFrame mainFrame;

private final JCheckBox song = new JCheckBox("Songs");

private final JCheckBox title = new JCheckBox("Title");

private final JCheckBox artist = new JCheckBox("Artist");

private final JCheckBox album = new JCheckBox("Album");

private final JTextField searchBox = new JTextField();

private final JButton searchButton = new JButton("Search");

public SearchWindow(MusicLib library,LibraryMainFrame mainFrame)

{

this.library = library;

this.mainFrame = mainFrame;

this.setLayout(null);

this.add(song);

song.setBounds(5, 5, 100, 20);

song.addActionListener(new songClick());

song.setSelected(true);

this.add(title);

title.setBounds(25,25,100,20);

title.setSelected(true);

this.add(artist);

artist.setBounds(25,45,100,20);

artist.setSelected(true);

this.add(album);

album.setBounds(5,65,100,20);

album.setSelected(true);

this.add(searchBox);

searchBox.setBounds(5,85,100,20);

searchBox.addActionListener(new Submit());

this.add(searchButton);

searchButton.setBounds(5,110,100,20);

searchButton.addActionListener(new Submit());

this.setVisible(true);

this.setResizable(false);

this.setSize(120,165);

this.setBounds((mainFrame.getX()+mainFrame.getWidth())/2, (mainFrame.getY()+mainFrame.getHeight())/2, 120, 165);

this.setTitle("");

}

private class songClick implements ActionListener

{

public void actionPerformed(ActionEvent arg0)

{

if(song.isSelected())

{

title.setEnabled(true);

artist.setEnabled(true);

}

else

{

title.setEnabled(false);

artist.setEnabled(false);

}

}

}

private class Submit implements ActionListener

{

public void actionPerformed(ActionEvent e) {

SearchList s = search.Search.search(library, searchBox.getText().trim(),new SearchOptions(song.isSelected(),album.isSelected(),title.isSelected(),artist.isSelected()));

s.print();

setVisible(false);

mainFrame.updateList(s);

mainFrame.updateTable(s);

}

}

}

I have created the code as instructed please make sure and if any queries please get back to me

Thank You