How can i programmatically put the label on imagePlus image?

I want to show label on the center of the image but i am facing problem while doing so, my image present in the JPanel Container so earlier i was trying to put label in the center of the container but while putting label in the container it always come right of the image, my goal is to put the label on top of the image how can i do that.

you can see in the image while trying to put label on the center of jpanel it always come right or bottom of the image.

I think you should use an non-destructive overlay which is better suited if you want to label classified components on an image instead of a layered Swing JLabel, see: