The problem is that the LayoutManager panel sets the label location for you.
What you need to do is set the layout to null by:
setLayout(null);
This will ensure that the frame / panel does not attempt to compose the components themselves.
Then call setBounds(Rectangle rect) on the shortcut. For instance:
lbl.setBounds(new Rectangle(new Point(200, 300), lbl.getPreferedSize())); This should place the component you want in.
However, unless you have a really big reason to LayoutManager components yourself, it is usually best to use the LayoutManager to work in your favor.
Here 's a great LayoutManager using LayoutManager s, if you should use an absolute though, then look at this tutorial
source share