List of utility methods to do JComponent Height
void | setMaximumHeight(JComponent comp, int iHeight) sets the maximum height of the given component (without changing its maximum width). comp.setMaximumSize(new Dimension(getMaximumWidth(comp), iHeight));
|
JComponent | setMinimumHeight(JComponent component, int height) set Minimum Height component.setMinimumSize(new Dimension(component.getMinimumSize().width, height)); return component; |
void | setPreferredHeight(final JComponent component, final int height) Sets the preferred height of the specified component. component.setPreferredSize(new Dimension(component.getPreferredSize().width, height));
|
void | setPreferredHeight(int height, JComponent... components) Sets all specified components to the same height. for (JComponent component : components) { component.setPreferredSize(new Dimension(component.getPreferredSize().width, height)); |
void | setPreferredHeight(JComponent component, int height) set Preferred Height component.setPreferredSize(new Dimension((int) component.getPreferredSize().getWidth(), height)); |
JComponent | setZeroHeight(JComponent comp) Sets the preferred height of a component to zero (0). Dimension dims = comp.getPreferredSize();
dims.height = 0;
comp.setPreferredSize(dims);
return comp;
|
void | updateComponentHeight(JComponent c) update Component Height for (Component child : c.getComponents()) { if (child instanceof JComponent) { updateComponentHeight((JComponent) child); child.setMinimumSize(child.getMinimumSize()); child.setPreferredSize(child.getPreferredSize()); child.setMaximumSize(child.getMaximumSize()); |