- for (int c = 0; c <= 9; c++) {
- JRadioButtonMenuItem radioitem = new JRadioButtonMenuItem(String.format("Channel %1d (%7.3fMHz)", c,
- 434.550 + c * 0.1),
- c == channel);
- radioitem.setActionCommand(String.format("%d", c));
- radioitem.addActionListener(this);
- add(radioitem);
- group.add(radioitem);
- }
+ for (int c = 0; c <= 9; c++)
+ addItem(String.format("Channel %1d (%7.3fMHz)", c, 434.550 + c * 0.1));
+ setSelectedIndex(channel);
+ setMaximumRowCount(10);