@Override
    public int createTextureAtlas(final int width, final int height) {
        try {
            // we initialize a buffer here that will be used as base for all texture atlas images
            if (initialData == null) {
                initialData = BufferUtils.createByteBuffer(width * height * 4);
                for (int i = 0; i < width * height; i++) {
                    initialData.put((byte) 0x00);
                    initialData.put((byte) 0x00);
                    initialData.put((byte) 0x00);
                    initialData.put((byte) 0xff);
                }
            }

            int atlasId = addTexture(createAtlasTextureInternal(width, height));

            return atlasId;
        } catch (Exception e) {
            log.log(Level.WARNING, e.getMessage(), e);
            return 0; // TODO Nifty always expects this call to be successful
            // there currently is no way to return failure or something :/
        }
    }
Nifty GUI BatchRenderBackend Implementation for jMonkeyEngine.

@author void
jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java