Is there a way to set the insets of a JFrame
?
I tried
frame.getContentPane().getInsets().set(10, 10, 10, 10);
and
frame.getInsets().set(10, 10, 10, 10);
but none of them seem to work.
JPanel contentPanel = new JPanel();
Border padding = BorderFactory.createEmptyBorder(10, 10, 10, 10);
contentPanel.setBorder(padding);
yourFrame.setContentPane(contentPanel);
So basically, contentPanel
is the main container of your frame.