setup things, not really sure what happened. oh yeah fix opencv
[3501/OpenCVShowImage] / ShowImage.java
index 91c307253dc2bb2356629ef826fca995adde042e..8a0adc7c4bc5af9ebd4e6bdb2a8ad379d4336a2e 100644 (file)
@@ -9,51 +9,51 @@ import javax.imageio.ImageIO;
 import javax.swing.JFrame;
 
 public class ShowImage extends Panel {
-    BufferedImage image;
-
-    public ShowImage() {
-        try {
-            // image file
-            // name is
-            // test.png
-            URL input = this.getClass().getResource(("test.png"));
-            // this will read the image to save
-            // into a BufferedImage variable
-            image = ImageIO.read(input);
-        } catch (IOException ie) {
-            // this is to spill
-            // out a message
-            // saying
-            // something
-            // doesn't work
-            System.out.println("Error: " + ie.getMessage());
-        }
-    }
-
-    public void paint(Graphics g) {
-        // This is to actually draw the image out,
-        // necessary.
-
-        // Input of a bufferedimage, x, y, then
-        // an observer in this case null.
-        g.drawImage(image, 0, 0, null);
-    }
-
-    static public void main(String args[]) throws Exception {
-        // Creates a window to
-        // display the image
-        JFrame frame = new JFrame("Display image");
-
-        // Gets the image from ShowImage() method
-        Panel panel = new ShowImage();
-
-        // Adds the image to the new window
-        // panel
-        frame.getContentPane().add(panel);
-
-        // sets the size of the panel
-        frame.setSize(500, 500);
-        // makes it visible
-        frame.setVisible(true);
-    }
+       BufferedImage image;
+
+       public ShowImage() {
+               try {
+                       // image file
+                       // name is
+                       // test.png
+                       URL input = this.getClass().getResource(("imgs/test.png"));
+                       // this will read the image to save
+                       // into a BufferedImage variable
+                       image = ImageIO.read(input);
+               } catch (IOException ie) {
+                       // this is to spill
+                       // out a message
+                       // saying
+                       // something
+                       // doesn't work
+                       System.out.println("Error: " + ie.getMessage());
+               }
+       }
+
+       public void paint(Graphics g) {
+               // This is to actually draw the image out,
+               // necessary.
+
+               // Input of a bufferedimage, x, y, then
+               // an observer in this case null.
+               g.drawImage(image, 0, 0, null);
+       }
+
+       static public void main(String args[]) throws Exception {
+               // Creates a window to
+               // display the image
+               JFrame frame = new JFrame("Display image");
+
+               // Gets the image from ShowImage() method
+               Panel panel = new ShowImage();
+
+               // Adds the image to the new window
+               // panel
+               frame.getContentPane().add(panel);
+
+               // sets the size of the panel
+               frame.setSize(500, 500);
+               // makes it visible
+               frame.setVisible(true);
+       }
 }