git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
587acea
)
avoid occasional null exception
author
jprocter
<Jim Procter>
Fri, 2 Apr 2010 09:39:51 +0000
(09:39 +0000)
committer
jprocter
<Jim Procter>
Fri, 2 Apr 2010 09:39:51 +0000
(09:39 +0000)
src/jalview/gui/Desktop.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/Desktop.java
b/src/jalview/gui/Desktop.java
index
7a8789d
..
77cf56f
100755
(executable)
--- a/
src/jalview/gui/Desktop.java
+++ b/
src/jalview/gui/Desktop.java
@@
-1650,11
+1650,13
@@
public class Desktop extends jalview.jbgui.GDesktop implements
{
if (percentUsage < 20)
g.setColor(Color.red);
-
- g.drawString("Total Free Memory: " + df.format(totalFreeMemory)
+ FontMetrics fm = g.getFontMetrics();
+ if (fm!=null)
+ { g.drawString("Total Free Memory: " + df.format(totalFreeMemory)
+ "MB; Max Memory: " + df.format(maxMemory) + "MB; "
+ df.format(percentUsage) + "%", 10, getHeight()
- - g.getFontMetrics().getHeight());
+ - fm.getHeight());
+ }
}
}