so basically you
1. defined the playerAvatar as a JLabel;
2. did not set the panel layout as null, so you used the flowlayout;

I would use whatever layout works best for the situation. In my code, I used the JPanel layout default, which you are correct, is FlowLayout.

Quote:

so I can not use a generic JComponent, but I have to define the avatar as a JLabel right?

You can use a JCompnent, but if all you're doing with it is showing the image, a JLabel does this much more simply and easily. If you use a JComponent, you'd have to also override getPreferredSize and have it return the size of the image. You might also would need to override getSize if you use null layout.

Quote:

why if I set the layout = null the image does not appear?

If you have a container use null layout, then you the coder are directly responsible for specifying the container's components' sizes and locations. I would only use this layout if I wanted to have the user manually drag a component around or if I wanted to animate the motion of a component.