title: How to use margins and paddings with Java GridLayout
body: <p>How can I keep a JLabel from displaying flush against the side of the frame? I have the same problem when using GridLayout or BoxLayout.</p>
  
  <p>Here's an example where this happens:</p>
  
  <pre><code>JPanel content = new JPanel();
  content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
  content.add(new JLabel("Hello World"));
  </code></pre>
  
  <p>CSS has the concept of margins and padding. Does Java have similar?</p>
  
  <p>I still want Left justified but with a few pixels of space between the edge and the label.</p>