@Override
    public void update(float tpf) {
        if (!isEnabled()) {
            return;
        }

        statistics.getData(statData);
        stringBuilder.setLength(0);

        // Need to walk through it backwards, as the first label
        // should appear at the bottom, not the top.
        for (int i = statLabels.length - 1; i >= 0; i--) {
            stringBuilder.append(statLabels[i]).append(" = ").append(statData[i]).append('\n');
        }
        statText.setText(stringBuilder);

        // Moved to ResetStatsState to make sure it is
        // done even if there is no StatsView or the StatsView
        // is disabled.
        //statistics.clearFrame();
    }
The <code>StatsView</code> provides a heads-up display (HUD) of various
statistics of rendering. The data is retrieved every frame from a
{@link com.jme3.renderer.Statistics} and then displayed on screen.
<p>
To use the stats view, you need to retrieve the
{@link com.jme3.renderer.Statistics} from the
{@link com.jme3.renderer.Renderer} used by the application. Then, attach
the <code>StatsView</code> to the scene graph.
<pre>
Statistics stats = renderer.getStatistics();
StatsView statsView = new StatsView("MyStats", assetManager, stats);
rootNode.attachChild(statsView);
</pre>
jme3-core/src/main/java/com/jme3/app/StatsView.java