Index: applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/MetaAction.java
===================================================================
--- applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/MetaAction.java	(revision 2943)
+++ applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/MetaAction.java	(revision 2944)
@@ -6,4 +6,6 @@
 import java.awt.BorderLayout;
 import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -19,6 +21,8 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
+import javax.swing.JTextField;
 
-import at.dallermassl.josm.plugin.surveyor.action.DialogClosingThread;
+import test.DialogClosingThread;
+
 
 import livegps.LiveGpsData;
@@ -111,41 +115,8 @@
             System.out.println("Surveyor: no gps data available!");
         }
-    }
-
-    public void openDialog(JFrame frame) {
-        final JOptionPane optionPane = new JOptionPane("The only way to close this dialog is by\n"
-                        + "pressing one of the following buttons.\n" + "Do you understand?",
-            JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);
-
-        final JDialog dialog = new JDialog(frame, "Click a button", true);
-        dialog.setContentPane(optionPane);
-        optionPane.addPropertyChangeListener(new PropertyChangeListener() {
-            public void propertyChange(PropertyChangeEvent e) {
-                String prop = e.getPropertyName();
-
-                if (dialog.isVisible() && (e.getSource() == optionPane)
-                                && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
-                    // If you were going to check something
-                    // before closing the window, you'd do
-                    // it here.
-                    dialog.setVisible(false);
-                }
-            }
-        });
-        Thread closer = new DialogClosingThread(dialog);
-        closer.start();
-        dialog.pack();
-        dialog.setVisible(true);
-        
-
-        System.out.println("value: " + optionPane.getValue().getClass());
-
-//        int value = ((Integer) optionPane.getValue()).intValue();
-//        if (value == JOptionPane.YES_OPTION) {
-//            System.out.println("yes");
-//        } else if (value == JOptionPane.NO_OPTION) {
-//            System.out.println("no");
-//        }
-
+        JFrame frame = SurveyorPlugin.getSurveyorFrame();
+        if(frame != null && frame.isVisible()) {
+            frame.toFront();
+        }
     }
 
@@ -156,26 +127,3 @@
         this.gpsDataSource = gpsDataSource;
     }
-    
-    public static void main(String[] args) {
-      //1. Create the frame.
-        JFrame frame = new JFrame("FrameDemo");
-
-        //2. Optional: What happens when the frame closes?
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
-        //3. Create components and put them in the frame.
-        //...create emptyLabel...
-        frame.getContentPane().add(new JLabel("test"), BorderLayout.CENTER);
-
-        //4. Size the frame.
-        frame.pack();
-        frame.setSize(600,400);
-        frame.setLocation(0,0);
-
-        //5. Show it.
-        frame.setVisible(true);
-        System.out.println("after visible");
-        new MetaAction().openDialog(frame);
-    }
-
 }
