JAL-1632 enable/disable CalculationChooser buttons on focus
authorJim Procter <jprocter@issues.jalview.org>
Tue, 2 May 2017 16:58:30 +0000 (17:58 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 2 May 2017 16:58:30 +0000 (17:58 +0100)
src/jalview/gui/CalculationChooser.java

index 694b096..fe6336e 100644 (file)
@@ -116,7 +116,20 @@ public class CalculationChooser extends JPanel
     frame = new JInternalFrame();
     frame.setContentPane(this);
     this.setBackground(Color.white);
+    frame.addFocusListener(new FocusListener()
+    {
+
+      @Override
+      public void focusLost(FocusEvent e)
+      {
+      }
 
+      @Override
+      public void focusGained(FocusEvent e)
+      {
+        validateCalcTypes();
+      }
+    });
     /*
      * Layout consists of 3 or 4 panels:
      * - first with choice of PCA or tree method NJ or AV