List of usage examples for java.awt Component isMaximumSizeSet
public boolean isMaximumSizeSet()
From source file:org.jdal.swing.form.SimpleBoxFormBuilder.java
/** * Add a component to Form at position pointer by cursor, * Increments cursor by one.//from w w w . ja v a 2 s . c om * @param c Component to add */ public void add(Component c) { if (debug) { if (c instanceof JComponent) ((JComponent) c).setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY)); } addBox(c); if (rowHeight < Short.MAX_VALUE) { Dimension d = c.getPreferredSize(); d.height = rowHeight; c.setPreferredSize(d); c.setMinimumSize(d); if (!c.isMaximumSizeSet() || c.getMaximumSize().getHeight() > rowHeight) { c.setMaximumSize(new Dimension(Short.MAX_VALUE, rowHeight)); } } }