super("Register VFW Caputure Devices");
setLayout(new FlowLayout());
int nDevices = 0;
removeCurrentDevices();
for (int i = 0; i < 10; i++) {
String name = VFWCapture.capGetDriverDescriptionName(i);
if (name != null && name.length() > 1) {
Button device = new Button(name);
add(device);
device.addActionListener( new DBListener(i) );
nDevices++;
}
}
devices = new CaptureDeviceInfo[nDevices];
pack();
addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent we) {
if (currentID != -1) {
System.err.println("Need to close other window first");
return;
}
dispose();
System.exit(0);
}
} );