super("SunVideoPlus");
Font lblFont = new Font("Dialog", Font.BOLD + Font.ITALIC, 12);
setLayout(new BorderLayout());
BorderPanel bp = new BorderPanel();
bp.setLayout(new BorderLayout(0, 0));
Panel p = new Panel();
p.setLayout(new FlowLayout(FlowLayout.LEFT));
Label lbl = new Label("Configure Capture Devices");
lbl.setFont(lblFont);
p.add(lbl);
bp.add(BorderLayout.NORTH, p);
p = new Panel();
p.setLayout(new FlowLayout());
int nDevices = 0;
for (int i = 0; i < 10; i++) {
File fl = new File(DEVICE_PREFIX + i);
if (fl.exists()) {
Button device = new Button(DEVICE_PREFIX + i);
p.add(device);
device.addActionListener( new DBListener(i) );
nDevices++;
}
}
bp.add(BorderLayout.CENTER, p);
add(BorderLayout.NORTH, bp);
devices = new CaptureDeviceInfo[nDevices];
p = new Panel();
p.setLayout(new FlowLayout());
Button bDone = new Button("Done");
bDone.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent ae) {
if (currentID != -1) {
System.err.println("Need to close other window first");
return;
}
dispose();
System.exit(0);
}
} );
p.add(bDone);
add(BorderLayout.SOUTH, p);
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);
}
} );