*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altosuilib_1;
+package org.altusmetrum.altosuilib_12;
import javax.swing.*;
import java.awt.*;
public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionListener {
- private AltosDevice value;
- private JList list;
- private JButton cancel_button;
- private JButton select_button;
- public Frame frame;
- public int product;
- public JPanel buttonPane;
+ private AltosDevice value;
+ private JList<AltosDevice> list;
+ private JButton cancel_button;
+ private JButton select_button;
+ public Frame frame;
+ public int product;
+ public JPanel buttonPane;
public AltosDevice getValue() {
return value;
select_button.setEnabled(false);
getRootPane().setDefaultButton(select_button);
- list = new JList(devices) {
+ list = new JList<AltosDevice>(devices) {
//Subclass JList to workaround bug 4832765, which can cause the
//scroll pane to not let the user easily scroll up to the beginning
//of the list. An alternative would be to set the unitIncrement
buttonPane.add(cancel_button);
buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
- add_bluetooth();
+ if (AltosUILib.has_bluetooth)
+ add_bluetooth();
buttonPane.add(select_button);