- Frame frame = JOptionPane.getFrameForComponent(frameComp);
- AltosDevice[] devices;
- devices = AltosDevice.list(product);
-
- if (devices != null && devices.length > 0) {
- value = null;
- dialog = new AltosDeviceDialog(frame, frameComp,
- devices,
- devices[0]);
-
- dialog.setVisible(true);
- return value;
- } else {
- /* check for missing altos JNI library, which
- * will put up its own error dialog
- */
- if (AltosUI.load_library(frame)) {
- JOptionPane.showMessageDialog(frame,
- "No AltOS devices available",
- "No AltOS devices",
- JOptionPane.ERROR_MESSAGE);
- }
- return null;
- }
+ private void update_devices() {
+ AltosDevice[] devices = devices();
+ list.setListData(devices);
+ select_button.setEnabled(devices.length > 0);