
// ImageViewer.java
// Michael Kolling and David J Barnes 
// version 0.1
// Modified by Andrew Davison, Jan 2018, ad@fivedots.coe.psu.ac.th

/* ImageViewer is the main class of the image viewer application. It builds
   and displays the application GUI and initialises all other components. 

   This version only displays a label.
*/


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


public class ImageViewer extends JFrame
{
    
  public ImageViewer()
  {
    super("ImageViewer 0.1");

    // create the GUI
    Container c = getContentPane();
    JLabel label = new JLabel("I am a label. I can display some text.");
    c.add(label);

    // set close behaviour for JFrame as exit
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // setSize(300, 200);
    pack();   // reduce frame size to fit GUI component
    setVisible(true);
  }  // end of ImageViewer()


  // ----------------------------------------------

  public static void main(String[] args) 
  {  new ImageViewer();  } 

} // end of ImageViewer class
