Simple Java text counter.