Java Code Examples for javax.swing.JComponent.setMaximumSize()

The following are Jave code examples for showing how to use setMaximumSize() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: incubator-netbeans   File: CompletionLayoutPopup.java   View Source Code Vote up 5 votes
/** 
 * Sets maximum size for appropriate JComponent, depending on
 * wheteher additional items are present
 */
private final void setMaxSize(JComponent comp, Dimension maxSize) {
    if (comp instanceof JPanel) {
        comp.getComponent(0).setMaximumSize(maxSize); // JScrollPane
    } else {
        comp.setMaximumSize(maxSize);
    }
}
 
Example 2
Project: incubator-netbeans   File: CompletionLayoutPopup.java   View Source Code Vote up 5 votes
/** 
 * Sets maximum size for appropriate JComponent, depending on
 * wheteher additional items are present
 */
private final void setMaxSize(JComponent comp, Dimension maxSize) {
    if (comp instanceof JPanel) {
        comp.getComponent(0).setMaximumSize(maxSize); // JScrollPane
    } else {
        comp.setMaximumSize(maxSize);
    }
}
 
Example 3
Project: incubator-netbeans   File: CompletionLayoutPopup.java   View Source Code Vote up 5 votes
/**
 * Sets maximum size for appropriate JComponent, depending on wheteher
 * additional items are present
 */
private void setMaxSize(JComponent comp, Dimension maxSize) {
    if (comp instanceof JPanel) {
        comp.getComponent(0).setMaximumSize(maxSize); // JScrollPane
    } else {
        comp.setMaximumSize(maxSize);
    }
}
 
Example 4
Project: geomapapp   File: SurveyPlannerSelector.java   View Source Code Vote up 4 votes
/**
 * align the component to the left side of the panel
 * @param comp
 */
void alignComponent(JComponent comp) {
	comp.setAlignmentX(Component.LEFT_ALIGNMENT);
	comp.setPreferredSize(compDim);
	comp.setMaximumSize(compDim);
}
 
Example 5
Project: geomapapp   File: MGGSelector.java   View Source Code Vote up 4 votes
void alignComponent(JComponent comp) {
	comp.setAlignmentX(Component.LEFT_ALIGNMENT);
	comp.setPreferredSize(compDim);
	comp.setMaximumSize(compDim);
}