Changeset 4907 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2012-02-07T21:35:45+01:00 (13 years ago)
Author:
jttt
Message:

access gui in edt

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java

    r4748 r4907  
    1919
    2020import javax.swing.JOptionPane;
     21import javax.swing.SwingUtilities;
    2122
    2223import org.openstreetmap.josm.Main;
     
    229230            }
    230231            if (!errors.isEmpty()) {
    231                 StringBuffer sb = new StringBuffer();
     232                final StringBuilder sb = new StringBuilder();
    232233                for (Object error : errors) {
    233234                    if (error instanceof String) {
     
    241242                sb.append("</ul>");
    242243
    243                 JOptionPane.showMessageDialog(Main.parent, "<html>"
    244                         + tr("The following errors occurred during mass download: {0}", sb.toString()) + "</html>",
    245                         tr("Errors during download"), JOptionPane.ERROR_MESSAGE);
     244                SwingUtilities.invokeLater(new Runnable() {
     245                    @Override
     246                    public void run() {
     247                        JOptionPane.showMessageDialog(Main.parent, "<html>"
     248                                + tr("The following errors occurred during mass download: {0}", sb.toString()) + "</html>",
     249                                tr("Errors during download"), JOptionPane.ERROR_MESSAGE);
     250                    }
     251                });
     252
    246253                return;
    247254            }
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java

    r4718 r4907  
    9999                    ((PleaseWaitProgressMonitor)progressMonitor).close();
    100100                }
    101                 afterFinish();
     101                if (EventQueue.isDispatchThread()) {
     102                    afterFinish();
     103                } else {
     104                    EventQueue.invokeAndWait(new Runnable() {
     105                        public void run() {
     106                            afterFinish();
     107                        }
     108                    });
     109                }
    102110            }
    103111        } catch (final Exception e) {
Note: See TracChangeset for help on using the changeset viewer.