set index of new annotation
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 7418e48..1068980 100755 (executable)
@@ -128,10 +128,12 @@ public class AnnotationLabels extends JPanel implements MouseListener,
                 label = "";\r
             }\r
 \r
-            ap.av.alignment.addAnnotation(new AlignmentAnnotation(label,\r
+            AlignmentAnnotation newAnnotation = new AlignmentAnnotation(label,\r
                     "New description",\r
-                    new Annotation[ap.av.alignment.getWidth()]));\r
+                    new Annotation[ap.av.alignment.getWidth()]);\r
 \r
+            ap.av.alignment.addAnnotation(newAnnotation);\r
+            ap.av.alignment.setAnnotationIndex(newAnnotation, 0);\r
             dif = aa[aa.length - 1].height;\r
         }\r
         else if (evt.getActionCommand().equals(HIDE))\r