package com.marinilli.b2.c8.splash;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

/**
 * Chapter 8 - An Application installed by the Splash class
 * @author Mauro Marinilli
 * @version 1.0
 */
public class App extends JFrame {

  public App() {
    ImageIcon img =
      new ImageIcon(getClass().getClassLoader().getResource("back.jpg"));
    JLabel aLabel = new JLabel(img);
    aLabel.setLayout(new BorderLayout());
    aLabel.add(new JLabel("An Application.."));
    getContentPane().add(aLabel);
    addWindowListener( new java.awt.event.WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        System.exit(0);
      }
    });
    pack();
    setVisible(true);
  }

  public static void main(String[] args) {
    App app = new App();
  }
}