public void actionPerformed(ActionEvent evt){
  Runtime runtime=Runtime.getRuntime();
  this.free=runtime.freeMemory();
  this.total=runtime.totalMemory();
  this.max=runtime.maxMemory();
  repaint();
}

public void actionPerformed ( ActionEvent evt ) { Runtime runtime = Runtime . getRuntime ( ) ; this . free = runtime . freeMemory ( ) ; this . total = runtime . totalMemory ( ) ; this . max = runtime . maxMemory ( ) ; repaint ( ) ; }
see specification at http : / / stackoverflow . com / a / 18375641
