Results 1 to 2 of 2
  1. #1
    ankurpict is offline Member
    Join Date
    Feb 2010
    Posts
    1
    Rep Power
    0

    Smile problem with camera code

    java.util.NoSuchElementException is coming in my code


    package ankur;
    import java.awt.Component;
    import java.awt.Frame;
    import java.util.Vector;
    import javax.media.CaptureDeviceInfo;
    import javax.media.CaptureDeviceManager;
    import javax.media.Manager;
    import javax.media.MediaLocator;
    import javax.media.Player;
    import javax.media.format.YUVFormat;

    /**
    *
    * @author Ankur
    */
    public class Main {

    /**
    * @param args the command line arguments
    */
    CaptureDeviceInfo device;
    MediaLocator ml=null;
    Player player=null;
    Component videoScreen=null;
    public static void main(String[] args) {
    // TODO code application logic here
    new Main();
    }

    Main() {
    try
    {
    //gets a list of devices which support the given videoformat
    Vector deviceList = CaptureDeviceManager.getDeviceList(new YUVFormat());

    device = (CaptureDeviceInfo) deviceList.firstElement();
    ml = device.getLocator();

    player = Manager.createRealizedPlayer(ml);
    player.start();



    videoScreen = player.getVisualComponent();
    Frame frm=new Frame();
    frm.setBounds(10,10,300,300);
    frm.add(videoScreen);
    frm.setVisible(true);

    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    }

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default

    You'll want to do printStackTrace(), and then tell us where it's being thrown from...

Similar Threads

  1. camera pic
    By Aveekdtt in forum CLDC and MIDP
    Replies: 0
    Last Post: 01-10-2010, 12:52 AM
  2. please help me in accessing integrated camera of PDA ???????
    By sri_reddy523 in forum CLDC and MIDP
    Replies: 1
    Last Post: 03-19-2009, 07:05 AM
  3. Loading a camera
    By mrvigneshmca in forum Java Applets
    Replies: 0
    Last Post: 03-18-2009, 10:46 AM
  4. Problem With POST command to control the network camera
    By sri_reddy523 in forum Networking
    Replies: 3
    Last Post: 03-16-2009, 06:53 AM
  5. How To Receive And Display Image From Network Camera
    By sri_reddy523 in forum Networking
    Replies: 11
    Last Post: 03-03-2009, 09:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •