Sitemap

Amicuk Programming Answers

Advise on debugging?

2015-10-11   Views:0

Advertisement

Hello, Could I ask, does this error mean the Render method cannot loop through the frames of the avi? Because the .avi could not be found? Thank you java.lang.NullPointerException at MyCustomCanvas.render(FrameRenderer.java:90) at MyCustomCanvas.pain

Hello,
Could I ask, does this error mean the Render method cannot loop through the frames of the avi?
Because the .avi could not be found?
Thank you
java.lang.NullPointerException
at MyCustomCanvas.render(FrameRenderer.java:90)
at MyCustomCanvas.paint(FrameRenderer.java:82)
at sun.awt.RepaintArea.paint(RepaintArea.java:177)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
at java.awt.Component.dispatchEventImpl(Component.java:3678)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
import javax.media.*;
import javax.media.control.*;
import javax.media.protocol.*;
import javax.media.util.*;
import javax.media.format.*;
public class FrameRenderer extends java.awt.Frame {
   public FrameRenderer() {
      super("");
      this.add(new MyCustomCanvas());
      this.setSize(500,500);
      this.show();
      addWindowListener(new WindowEventHandler());
   class WindowEventHandler extends WindowAdapter{
      public void windowClosing(WindowEvent e) {
         System.exit(0);
   public static void main(String[] args) {
      new FrameRenderer();
class MyCustomCanvas extends Canvas {
   MediaLocator videoSource = new
   MediaLocator("c:waiting.avi");
   Player p;
   FramePositioningControl positioner;
   FrameGrabbingControl grabber;
   VideoFormat vFormat;
   Buffer buffer;
   BufferToImage bToImage;
   java.awt.Image captured;
   public MyCustomCanvas() {
      try {
         Manager.setHint(Manager.PLUGIN_PLAYER, new Boolean(true));
         p = Manager.createRealizedPlayer(videoSource);
         positioner = (FramePositioningControl) p.getControl(
              "javax.media.control.FramePositioningControl");
         if(positioner == null) {
            System.err.println("Error in Getting Positioning Control");
            System.exit(1);
         grabber = (FrameGrabbingControl) p.getControl(
              "javax.media.control.FrameGrabbingControl");
         if(grabber == null) {
            System.err.println("Error in Getting Grabber Control");
            System.exit(1);
      } catch (IOException ioe) {
      } catch (NoPlayerException nple) {
      } catch (CannotRealizeException cre) {
   public void update(Graphics g) {
      paint(g);
   public void paint(Graphics g) {
      Graphics2D g2d = (Graphics2D) g;
      render(g2d);
      System.exit(1);
   public void render(Graphics2D g2d) {
      int i = 1;
      for(;i < 100;i++) {
         positioner.seek(i);
         buffer = grabber.grabFrame();
         vFormat = (VideoFormat) buffer.getFormat();
         bToImage = new BufferToImage(vFormat);
         captured = bToImage.createImage(buffer);
         g2d.drawImage(captured,0,0,null);
         synchronized (this) {
         try {
            wait(100);
         } catch (InterruptedException ie) {}
}

The replay answer
Advertisement
also replce the following line
MediaLocator videoSource = new
MediaLocator("c:waiting.avi");
with [
MediaLocator videoSource = new
   MediaLocator("c:\\waiting.avi");
/code]                                                                                                                                                                                                                                                                                                                                                                                       

Go to See the other 15 answers

Advise on debugging?

Category:DefaultRelease time:2015-10-11Views:130

Hello, Could I ask, does this error mean the Render method cannot loop through the frames of the avi? Because the .avi could not be found? Thank you java.lang.NullPointerException at MyCustomCanvas.render(FrameRenderer.java:90) at MyCustomCanvas.pain[More]

How to debug a report in production server

Category:DefaultRelease time:2015-10-11Views:130

hello all, how to debug a report in production ... do i need to BREAK statement of that particular user..... thanks in advance....Vinay, Process of Debugging in Production will be same as in Development or Quality. But,it is not advisable to debug in[More]

REGORDING DEBUGGING

Category:DefaultRelease time:-0001-11-30Views:130

13.     If u set a break-point between select and endselect , a dump is likely to happen .Why A     Debugging forces a commit work while the LUW for the select is not complete until all the records for the where clause is not fetched. Hence a LUW cla[More]

Create cl_crm_bol_entity and commit doesn't work!

Category:DefaultRelease time:2015-10-11Views:130

When i select a row in my first tableview the my second tableview will be filled. In my second tableview i have a insert button to insert an extra record in the tableview. I redefined the EH_ONINSERT event with the following code: DATA: lr_wrapper  [More]

Max (log_Sequence) not  increasing

Category:DefaultRelease time:-0001-11-30Views:130

Max(log_sequence) is not increasing even after enabling the profile option for debugging SQL> select max (log_Sequence) from fnd_log_messages; MAX(LOG_SEQUENCE) 993232471 What could be the issue here...?You did not provide details about the profile o[More]

Still having navigation problems and need help with how to debug

Category:DefaultRelease time:2015-10-11Views:130

Hi, I've been porting over a servlet project to JSF and I'm still having navigation problems. I thought the problem might have been because the original project used HTML frames and so the "from-view-id" JSP defined the frame/framesets and the s[More]

Kernel panics & grey debug screen at startup

Category:DefaultRelease time:2015-10-11Views:130

Tiger (10.4.10) on a 2 GHz Mac mini (Intel) and Airport as well as IPv6 disabled. Not sure which torrent client I installed first but I think it was Transmission and everything was fine. Then I installed Azureus on the advise of a friend and started[More]

How to debug a form (servlet) in the Forms and Reports Server

Category:DefaultRelease time:2015-10-11Views:130

Hi: I have a new install of an application that ran perfectly on a different host using the Forms and Reports Server. I have installed the FRS on the new host and it is working fine. I can run the test form. When I run my actual forms app, I only get[More]

Unable to use debug mode for x64 application and debug doesn't work when target cpu set to x86

Category:DefaultRelease time:2015-10-11Views:130

I am attempting to familiarize myself with Visual Basic programming in Visual Studio 2008, using the Visual Basic Guided Tour in Microsoft Visual Studio 2008 Documentation, and have run into a bit of a road-block.  When following the lesson "It Doesn[More]

How do you choose a particular Channel from an Advise.vi to perform an Array Max & Min.vi on that particular channel only?

Category:DefaultRelease time:2015-10-11Views:130

Reading all the channels for a FP-AI-100 through an Advise.vi but I need to read the Max & Min from channels 0 & 1. How is this done? ThanksThe easiest way is to use two copies of the Index Array function. You would wire the output from FP Advise.[More]

How to collect debug logs for custom module only in EBS by AppsLog.write?

Category:DefaultRelease time:2015-10-11Views:130

Hi, Customer is trying to retrieve logs for their custom module (XXKCZ) and put it to /log/kcz.log by using AppsLog.write() method. (refer to sample code below) Customer has set these profile values in the application level and removed the values in[More]

Hot
I recently started working for a public school district that runs Windows Server 2003 and Windows Server 2008 R2. There are several faculty members, myself included, that would like to get their Macs onto the domain and capable of file sharing, print [More]
I have a simple formmail form using a cgi script. Works fine, with one minor problem... All my pages have simple "wrapper" to contain content in the center (790px wide). In all browsers I tried (IE, safari, opera) except Firefox 3.0, all of my p [More]
I'm using Dreamweaver CS4. It seems that access levels can only be applied (at least through Server Behaviors) to a field within the same table that host the users and their associated passwords. I have adopted a database which contains a table which [More]
Howdy gang! I have inherited an application with a fairly large number of cfcs. The codebase goes back quite a few years. Though the code is in mostly decent shape, as with most long lived apps, there are files no longer in use, etc. I am hoping to f [More]
I am not able to burn CDs each time I open Itunes I get the following error.  "Itunes was not properly Installed. If you wish to import or burn CDs you need to reinstall Itunes"  And when I try to burn a CS using Itunes I get that nu Burner is f [More]
I got it all set up.  Put the cartridges in.  Started autosetup.  This is the initial set up. "Print cartridge M is not installed.*  Please open er up, clear paper jam.  so I opened her up, cleared all paper.  Closed er up. Same error message. Open u [More]
was trying to save thunderbird so i can transfer it to a new computer and i some how lost my address booki had to do it manually and i copied the file and went to put it on a disc but the disc wasnt big enough. so i went and deleted some of my emails [More]
Hi I wish to dynamically assign a table variant with a cell editor of type checkbox and then check/uncheck/make readonly the field accordign various situations. I only wish this to happen on certain rows. So far I can achieve this my using context at [More]
Hi, I'm checking for updates to Photoshop CS5 *Extended* and only find regular CS5 updates.  Do they work on Extended?  Without removing the "Extended" aspects?  Thanks for any help you can provide.Do they work on Extended?  Without removing the [More]
I've noticed this problem since I upgraded to Yosemite. My Facetime app does not work. Either I will connect someone and I will constantly hear the ringing of a facetime call even after the call has been answered, or my speakers will cut out and we w [More]