I use multiple components that has a border painted. Is there any easy way to add a margin to the component so that the borders aren’t painted so close to eachother?
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.
This is typically done using your layout manager. For example, if you are using
GridBagLayout, you would setinsetson theGridBagConstraintobject to the desired value.Another option is to use the
Boxobject and add a horizontal or vertical struct. See javadoc forBox.createVerticalStrut( int width )and the similarcreateHorizontalStrut.