Weight « Layout « Java Swing Q&A





1. Lightest-weight spacer component in a GridBagLayout    stackoverflow.com

In a GridBagLayout, what component is the best for providing empty space in a panel? Ideally I would like to use a component that has:

  1. Low overhead
  2. No side effect when no ...

2. Change the component weight dynamically in GridBagLayout    stackoverflow.com

Suppose now there are some components inside a JPanel and the layout is arranged using GridBagLayout. Is it possible to change the weight(weightx or weighty) of the components dynamically (e.g. ...

3. JScrollPane Weight Shift In GridBagLayout    coderanch.com

The problem with this layout has to do with the JScrollPane which is on the third (cell 5) last cell in the grid. When text is appended to the JTextArea within the JScrollPane, the weight of the JScrollPane expands, thus pushing downward the two items in the last two cells. The lowermost cell is a JLabel for status messages. When text ...