Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unexpected exception: java.lang.reflect.InvocationTargetException Help!

843802Sep 19 2006 — edited Jan 31 2008
What this error mean. Help! I dont understand. The program is running when I try to run it but when I try to deploy it using JNLP it wont work.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Cutout$1
at Cutout.<init>(Cutout.java:45)
at Cutout.main(Cutout.java:175)
... 11 more

It seems like the error is at line 45 of my code. My code starting from line 45 is this...
	capture.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				try {
					java.awt.Point pos = jFrame.getLocationOnScreen();

					javax.imageio.ImageIO.write(shot.getSubimage(pos.x + 3, pos.y + 27, jFrame.getWidth() - 7, jFrame.getHeight() - 30), "jpg", new java.io.File("image.jpg"));
				} catch(java.io.IOException ioe) {
					ioe.printStackTrace();
				}
            }
        });
	popup.add(capture);

	refresh = new javax.swing.JMenuItem("Refresh");
	refresh.setMnemonic('R');
        refresh.addActionListener(new java.awt.event.ActionListener() {
		public void actionPerformed(java.awt.event.ActionEvent evt) {
				refresh();
            }
        });
	popup.add(refresh);

	exit = new javax.swing.JMenuItem("Exit");
	exit.setMnemonic('x');
        exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				jFrame.setVisible(false);
				jFrame.dispose();
				System.exit(0);
            }
        });
	popup.add(exit);

        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                popup.show(evt.getComponent(), evt.getX(), evt.getY());
            }
        });
Is there something wrong with this one?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2008
Added on Sep 19 2006
5 comments
3,222 views