Changed license to CC0
[imagesqueeze.git] / src / main / java / eu / svjatoslav / imagesqueeze / sampleApplication / ImageFrame.java
1 /*
2  * Image codec. Author: Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
3  * This project is released under Creative Commons Zero (CC0) license.
4  */
5 package eu.svjatoslav.imagesqueeze.sampleApplication;
6
7 import javax.swing.*;
8 import java.awt.*;
9
10 public class ImageFrame extends javax.swing.JFrame {
11     private ImagePanel imagePanel1;
12
13     public ImageFrame(final String title) {
14         super();
15         setTitle(title);
16         initGUI();
17     }
18
19     /**
20      * Auto-generated main method to display this JFrame
21      */
22     public static void main(final String[] args) {
23         SwingUtilities.invokeLater(() -> {
24             final ImageFrame inst = new ImageFrame("test");
25             inst.setLocationRelativeTo(null);
26             inst.setVisible(true);
27         });
28     }
29
30     public ImagePanel getImagePanel() {
31         return imagePanel1;
32     }
33
34     private void initGUI() {
35         try {
36             final BorderLayout thisLayout = new BorderLayout();
37             setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
38             getContentPane().setLayout(thisLayout);
39             {
40                 imagePanel1 = new ImagePanel();
41                 getContentPane().add(getImagePanel(), BorderLayout.CENTER);
42             }
43             pack();
44         } catch (final Exception e) {
45             e.printStackTrace();
46         }
47     }
48
49 }