I have a JPanel which is set to BorderLayout. I have added 2 JPanels inside this panel, one south and one center. In the center panel, i added a LowerBevelBorder. I am finding i am not able to leave a gap between the Main frame and the border. How do i do that? This is my panel1.setBorder(BorderFactory.createLoweredBevelBorder());
I have a JPanel which is set to BorderLayout . I have added 2
Share
Use a compound border which allows you to nest borders without having to create containers just for this purpose. The API can help you set this up. e.g.,
Note code not tested.
Note also that this depends on what panel1 is. If it’s not the BorderLayout main JPanel, then your best bet is to set the Border of the BorderLayout-using JPanel to be an EmptyBorder.