- if (returnVal == JFileChooser.APPROVE_OPTION) {
- file = hexfile_chooser.getSelectedFile();
- if (file != null) {
- try {
- input = new FileInputStream(file);
- thread = new Thread(this);
- thread.start();
- } catch (FileNotFoundException ee) {
- JOptionPane.showMessageDialog(frame,
- file,
- "Cannot open flash file",
- JOptionPane.ERROR_MESSAGE);
- }
- }
- }
+ public AltosFlash(File in_file, AltosDevice in_debug_dongle) {
+ file = in_file;
+ debug_dongle = in_debug_dongle;
+ debug = new AltosDebug();