I need help with setting the x and y position of a JLabel on a JPanel, not North,South,West,East.
Thank you for your time.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To have a JPanel respect exact locations, you should set its layout to null. Then, you can use
setLocationon any JComponent to set its location within that JPanel.However, note that there are several downsides of absolute position (mentioned in comments below), and that you should utilize a LayoutManager to position your components.