Changeset 10176 in josm


Ignore:
Timestamp:
2016-05-10T20:06:41+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #12776 - "Correlate to gpx" doesn't refresh combo box after GPX file selection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r10173 r10176  
    5454import javax.swing.JSlider;
    5555import javax.swing.ListSelectionModel;
     56import javax.swing.MutableComboBoxModel;
    5657import javax.swing.SwingConstants;
    5758import javax.swing.event.ChangeEvent;
     
    310311                }
    311312
     313                MutableComboBoxModel<GpxDataWrapper> model = (MutableComboBoxModel<GpxDataWrapper>) cbGpx.getModel();
    312314                loadedGpxData.add(data);
    313315                if (gpxLst.get(0).file == null) {
    314316                    gpxLst.remove(0);
    315                 }
    316                 gpxLst.add(new GpxDataWrapper(sel.getName(), data, sel));
     317                    model.removeElementAt(0);
     318                }
     319                GpxDataWrapper elem = new GpxDataWrapper(sel.getName(), data, sel);
     320                gpxLst.add(elem);
     321                model.addElement(elem);
    317322                cbGpx.setSelectedIndex(cbGpx.getItemCount() - 1);
    318323            } finally {
Note: See TracChangeset for help on using the changeset viewer.