Make sure fontmetrics exists for headless state
authoramwaterhouse <Andrew Waterhouse>
Mon, 19 Sep 2005 13:41:25 +0000 (13:41 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 19 Sep 2005 13:41:25 +0000 (13:41 +0000)
src/jalview/gui/AnnotationPanel.java

index 8a220b8..15bc284 100755 (executable)
@@ -608,6 +608,9 @@ public class AnnotationPanel extends JPanel implements MouseListener,
      */\r
     public void drawComponent(Graphics2D g, int startRes, int endRes)\r
     {\r
+               if(fm==null)\r
+                       fm = g.getFontMetrics();\r
+\r
         g.setColor(Color.white);\r
         g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getHeight());\r
 \r