Index: applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java
===================================================================
--- applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java	(revision 23437)
+++ applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java	(revision 23443)
@@ -9,4 +9,8 @@
     boolean start();
     boolean stop();
+    boolean hasFocus();
+    boolean lostFocus();
+    int getIndex();
+    void setIndex(int index);
     String getName();
     String getFileName();
Index: applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java
===================================================================
--- applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java	(revision 23437)
+++ applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java	(revision 23443)
@@ -32,4 +32,6 @@
 	static private List<SmedPluggable> plugins = null;
 	static private JTabbedPane tabbedPane = null;
+	@SuppressWarnings("unused")
+	private int activeIndex = -1;
 	
     public SmedTabbedPane() {
@@ -42,15 +44,8 @@
 
             if(plugins != null) {
+
+            	if(tabbedPane == null) tabbedPane = new JTabbedPane();
+
             	ImageIcon icon = null;
-            	if(tabbedPane == null) { 
-            		tabbedPane = new JTabbedPane();
-            		tabbedPane.addChangeListener(new ChangeListener() {
-
-						@Override
-						public void stateChanged(ChangeEvent event) {
-							System.out.println("hello world");
-						}
-            		});
-            	}
 
             	JComponent panel;
@@ -68,4 +63,9 @@
             			tabbedPane.addTab(p.getName(),icon, panel, p.getInfo());
             			tabbedPane.setMnemonicAt(i, KeyEvent.VK_1 + i);
+            			if(i == 0) { 
+            				p.hasFocus();
+            				activeIndex = 0;
+            			}
+            			p.setIndex(i);
                     	
             			i++;
@@ -80,4 +80,26 @@
             	//The following line enables to use scrolling tabs.
             	tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
+            	
+            	// add ChangeListener
+            	tabbedPane.addChangeListener(new ChangeListener() {
+
+					@Override
+					public void stateChanged(ChangeEvent event) {
+						System.out.println("hello world");
+						System.out.println("activeIndex:\t" + activeIndex);
+						JTabbedPane pane = (JTabbedPane) event.getSource();
+						
+						for(SmedPluggable p : plugins) {
+							if(p.getIndex() == activeIndex) p.lostFocus();
+						}
+						
+						System.out.println(pane.getSelectedIndex());
+						activeIndex = pane.getSelectedIndex();
+						for(SmedPluggable p : plugins) {
+							if(p.getIndex() == activeIndex) p.hasFocus();
+						}
+					}
+            	});
+
         	}
         } catch (IOException e) {
@@ -89,11 +111,3 @@
     public static List<SmedPluggable> getPlugins() { return plugins; }
     public static JTabbedPane getTabbedPane() { return tabbedPane; }
-
-    /*
-	@Override
-	public void stateChanged(ChangeEvent event) {
-		System.out.println("hello world");
-		
-	}
-	*/
 }
