how I can add space between JFrame and a JPanel inserts into this JFrame? I would insert space in the way that the elements inside the JPanel didn’t appear too near at the JFrame
Share
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.
Set the JPanel’s border with an EmptyBorder with appropriate parameters.
i.e.,
If the JPanel already has a border, then you can either use a compound border or wrap the JPanel in another JPanel, say using BorderLayout and in the BorderLayout.CENTER position, and give the wrapper JPanel an empty border.