public void setTexture(AssetManager assetManager, Texture2D tex, boolean useAlpha){
        if (getMaterial() == null){
            Material mat = new Material(assetManager, "Common/MatDefs/Gui/Gui.j3md");
            mat.setColor("Color", ColorRGBA.White);
            setMaterial(mat);
        }
        material.getAdditionalRenderState().setBlendMode(useAlpha ? BlendMode.Alpha : BlendMode.Off);
        material.setTexture("Texture", tex);
    }
Set the texture to put on the picture.

@param assetManager The {@link AssetManager} to use to load the material.
@param tex The texture
@param useAlpha If true, the picture will appear transparent and allow
objects behind it to appear through. If false, the transparent
portions will be the image's color at that pixel.
jme3-core/src/main/java/com/jme3/ui/Picture.java