Normally, you shouldn’t have to go through gymnastics to get the alpha channel from a texture; it should just be there when you load the texture. (You might have to do model.setTransparency(TransparencyAttrib.MAlpha) to see the effects of alpha, however.)
You can query whether the texture has been successfully loaded along with its alpha channel by calling tex.getNumComponents(). It should return 4 if it has an alpha channel.
If your 4-channel TGA file is being loaded with only 3 channels (components), then try converting the TGA file to some other format that supports alpha, such as TIFF or PNG. I have recently seen evidence that the TGA decoder we are using sometimes has difficulty finding the alpha channel.
In my code, I had to specifically enable transparency for the render path during program initialization, similar to what David mentions. In the 2d case:
Setting for aspect2d will specifically enable transparency on all images in the 2d HUD render path. You could set it for any node you want, such as render2d (the 2d screen), render (the 3d camera scene), or any model node for more fine-grained control.
I’m successfully using alpha channels on both TIF and PNG textures with no problems.
Note that David uses TransparencyAttrib.MAlpha, whereas I simply use 1. They are numerically equivalent, but I don’t know if there’s a chance the value might change some time in the future. It might be safer to use the named constant.