Check if graphics is null in labelSize
authoramwaterhouse <Andrew Waterhouse>
Fri, 21 Jan 2005 18:29:07 +0000 (18:29 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 21 Jan 2005 18:29:07 +0000 (18:29 +0000)
src/jalview/gui/IdCanvas.java

index 6d4a5b9..1bf5cc6 100755 (executable)
@@ -158,6 +158,8 @@ public class IdCanvas extends JPanel
 \r
   public Dimension getLabelWidth()\r
   {\r
+    if(getGraphics()==null)\r
+      return null;\r
 \r
    FontMetrics fm = this.getGraphics().getFontMetrics(av.font);\r
    AlignmentI al = av.getAlignment();\r