/* MemMonitor.java Display memory values. Rich Acuff 2-Oct-97 */ import java.awt.*; public class MemMonitor extends Monitor { Label freeL, totalL; int free, total; Runtime rt; public MemMonitor (Label f, Label t) { freeL = f; totalL = t; rt = Runtime.getRuntime(); show(); } public void reset () { show(); } public long getFree () { return rt.freeMemory(); } public long getTotal () { return rt.totalMemory(); } public void show () { freeL.setText(RichUtil.longToString(rt.freeMemory())); totalL.setText(RichUtil.longToString(rt.totalMemory())); } public String toString () { return Long.toString(rt.freeMemory()); } }