Results 1 to 2 of 2
Thread: problem with camera code
- 02-12-2010, 03:50 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 1
- Rep Power
- 0
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);
}
}
}
- 02-12-2010, 04:45 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
camera pic
By Aveekdtt in forum CLDC and MIDPReplies: 0Last Post: 01-10-2010, 12:52 AM -
please help me in accessing integrated camera of PDA ???????
By sri_reddy523 in forum CLDC and MIDPReplies: 1Last Post: 03-19-2009, 07:05 AM -
Loading a camera
By mrvigneshmca in forum Java AppletsReplies: 0Last Post: 03-18-2009, 10:46 AM -
Problem With POST command to control the network camera
By sri_reddy523 in forum NetworkingReplies: 3Last Post: 03-16-2009, 06:53 AM -
How To Receive And Display Image From Network Camera
By sri_reddy523 in forum NetworkingReplies: 11Last Post: 03-03-2009, 09:22 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks