Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to have space between components, you can either add an empty border to one or both components, or insert invisible components to provide the space. You can create invisible components with the help of the Box class.</p> <p>since you already used glue with no success (I doubt why?), you may try something like <em>Rigid area</em>,</p> <pre><code>container.add(firstComponent); container.add(Box.createRigidArea(new Dimension(5,0))); container.add(secondComponent); </code></pre> <p>Have a look at <a href="http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html#filler" rel="noreferrer">Using Invisible Components as Filler</a> which gives you a lot of options and explanations.</p> <hr> <p>ADDITIONAL INFORMATION, From <a href="http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html#space" rel="noreferrer">Putting Space Between Components</a>,</p> <p>Three factors influence the amount of space between visible components in a container:</p> <ul> <li><p>The layout manager</p> <blockquote> <p>Some layout managers automatically put space between components; others do not. Some let you specify the amount of space between components. See the how-to page for each layout manager for information about spacing support.</p> </blockquote></li> <li><p>Invisible components</p> <blockquote> <p>You can create lightweight components that perform no painting, but that can take up space in the GUI. Often, you use invisible components in containers controlled by <code>BoxLayout</code>. See <a href="http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html" rel="noreferrer">How to Use BoxLayout</a> for examples of using invisible components.</p> </blockquote></li> <li><p>Empty borders</p> <blockquote> <p>No matter what the layout manager, you can affect the apparent amount of space between components by adding empty borders to components. The best candidates for empty borders are components that typically have no default border, such as panels and labels. Some other components might not work well with borders in some look-and-feel implementations, because of the way their painting code is implemented. For information about borders, see <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html" rel="noreferrer">How to Use Borders</a> .</p> </blockquote></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload