package com.han;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
/**
* If the graphic files are loaded from an initial thread, there may be a delay
* before the GUI appears. If the graphic files are loaded from the event
* dispatch thread, the GUI may be temporarily unresponsive. So we use
* SwingWorker as a background processing for the loading of image files.
* <p>
* This application needs the customization of the image files' informations in
* the private inner class "LoadImages".
*
* @author HAN
* @version 1.0
* @see IconDemoAPP2 version 2.0
*/
@SuppressWarnings("serial")
public class IconDemoAPP extends JPanel {
private static JFrame frame;
private JLabel photoLabel;
private JToolBar toolBar;
private int displayZone = 400;
/**
* The constructor serves as the content pane construction.
*/
IconDemoAPP() {
// JPanel uses FlowLayout by default. We set it to BorderLayout for
// use of tool bar. This JPanel will be used as content pane.
setLayout(new BorderLayout());
// Creat