@Override
    protected void onEnable() {
        // Set the number of visible frames to the current width of the screen
        setFrameCount(getApplication().getCamera().getWidth());

        getApplication().setAppProfiler(profiler);
        Node gui = ((SimpleApplication) getApplication()).getGuiNode();
        gui.attachChild(graph);
        gui.attachChild(background);
    }
Sets the number frames displayed and tracked.
@param count the number of frames
jme3-core/src/main/java/com/jme3/app/BasicProfilerState.java