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