Index: applications/editors/josm/plugins/smed/src/smed/Smed.java
===================================================================
--- applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 23389)
+++ applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 23393)
@@ -32,6 +32,6 @@
 
     private JMenuItem item;
-    private SmedTabAction SmedTab;
-	private List<SmedPluggable> plugins = null;
+    private SmedTabAction smedTab;
+	// private List<SmedPluggable> plugins = null;
 
     public Smed(PluginInformation info) {
@@ -135,7 +135,8 @@
         }
         
-        SmedTab = new SmedTabAction();
-        item = Main.main.menu.toolsMenu.add(SmedTab);
-
+        smedTab = new SmedTabAction();
+        item = Main.main.menu.toolsMenu.add(smedTab);
+        smedTab.setOsmItem(item);
+        
         item.setEnabled(false);
 
@@ -148,12 +149,14 @@
         } else {
             item.setEnabled(false);
-            // SmpDialog.CloseDialog();
+            smedTab.closeDialog();
         }
     }
 
+    /*
     public void setPlugins(List<SmedPluggable> plugins)  {
     	this.plugins = plugins;
     	
     }
+    */
 
 }
Index: applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabAction.java
===================================================================
--- applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabAction.java	(revision 23389)
+++ applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabAction.java	(revision 23393)
@@ -10,4 +10,5 @@
 
 import javax.swing.JFrame;
+import javax.swing.JMenuItem;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
@@ -28,5 +29,8 @@
 	private SmedTabbedPane smedTabs = new SmedTabbedPane();
 	private SmedMenuBar smedMenu = new SmedMenuBar();
-
+	private JFrame frame = null;
+	private boolean isOpen = false;
+	private JMenuItem osmItem;
+	
     public SmedTabAction() {
         super( "Seekarten Editor", "Smed","Seekarten Editor", Shortcut.registerShortcut(
@@ -44,4 +48,9 @@
             }
         });
+        
+        isOpen = true;
+		if (osmItem == null) return;
+
+		osmItem.setEnabled(false);
     }
 
@@ -49,5 +58,5 @@
     protected void createAndShowTabs() {
         //Create and set up the window.
-        JFrame frame = new JFrame("TabbedPaneDemo");
+        frame = new JFrame("TabbedPaneDemo");
         frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
         frame.setResizable(false);
@@ -65,3 +74,23 @@
 
 
+	public void closeDialog() {
+		List<SmedPluggable> plugins = SmedTabbedPane.getPlugins();
+		
+		if(plugins != null) {
+			for(SmedPluggable p : plugins) p.stop();
+		}
+		
+		if(isOpen) {
+			frame.setVisible(false);
+			frame.dispose();
+		}
+		
+		isOpen = false;
+	}
+
+
+	public void setOsmItem(JMenuItem item) {
+		osmItem = item;		
+	}
+
 }
