I want to programmatically move my JLabel to a specific location inside my JPanel. I have tried setLocation(int x, int y)
, but it doesn't work.
I am trying to not use any layout manager.
views:
150answers:
1
+1
A:
Here is a great tutorial on how to layout your components without using a layout manager.
http://java.sun.com/docs/books/tutorial/uiswing/layout/none.html
Creating a container without a layout manager involves the following steps.
- Set the container's layout manager to null by calling
setLayout(null)
.- Call the Component class's
setbounds
method for each of the container's children.- Call the Component class's
repaint
method.
jjnguy
2010-06-21 13:50:11