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

(Java language, IDE NetBeans 8.0.2) - My Photos : create a photo album applicati

ID: 670248 • Letter: #

Question

(Java language, IDE NetBeans 8.0.2) -

My Photos :

create a photo album application. The application will load a collection of images and displays them in a photo album layout (im not sure how this part works if you could explain more on how to have the application load a collection of images and how it displays them.). The program will allow the user to tag images with metadata:

• Title for the photo. Limited to 100 characters.

• Description for the photo. Limited to 300 characters.

• Date taken

• Place taken

Functional Specification : (these specifications are very important and im not sure how to do these.)

1. The album should be able to display the pictures sorted by Title, Date, and Place.

2. When the user clicks on a photo, the metadata should be displayed. (i really dont understand this part)

3. The user should be able to add or remove photos from the album

*/ could you add comments to whats going on? this is how i best learn is seeing a working code and dissecting the code to figure out what is going on. /*

Explanation / Answer

import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;

public class ImageDemo
{
public static void main(String[] args) throws

Exception
{
    new ImageDemo(args[0]);
}

public ImageDemo(final String filename)

throws Exception
{
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        JFrame editorFrame = new JFrame("Image

Demo");
        editorFrame.setDefaultCloseOperation

(WindowConstants.EXIT_ON_CLOSE);
      
        BufferedImage image = null;
        try
        {
          image = ImageIO.read(new File

(filename));
        }
        catch (Exception e)
        {
          e.printStackTrace();
          System.exit(1);
        }
        ImageIcon imageIcon = new ImageIcon

(image);
        JLabel jLabel = new JLabel();
        jLabel.setIcon(imageIcon);
        editorFrame.getContentPane().add

(jLabel, BorderLayout.CENTER);

        editorFrame.pack();
        editorFrame.setLocationRelativeTo

(null);
        editorFrame.setVisible(true);
      }
    });
}
}