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

The following are Jave code examples for showing how to use getMaximumSize() 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 6 votes
final Dimension getPreferredSize() {
    JComponent comp = getContentComponent();

    if (comp == null)
        return new Dimension(0, 0);
    
    int screenWidth = Utilities.getUsableScreenBounds().width;
    
    Dimension maxSize = new Dimension((int) (screenWidth * MAX_COMPL_COVERAGE),
            comp.getMaximumSize().height); //set maximum part of screen covered
    setMaxSize(comp, maxSize);
    
    return comp.getPreferredSize();
}
 
Example 2
Project: incubator-netbeans   File: CompletionLayoutPopup.java   View Source Code Vote up 5 votes
final Dimension getPreferredSize() {
    JComponent comp = getContentComponent();

    if (comp == null)
        return new Dimension(0, 0);
    
    int screenWidth = Utilities.getUsableScreenBounds().width;
    
    Dimension maxSize = new Dimension((int) (screenWidth * MAX_COMPL_COVERAGE),
            comp.getMaximumSize().height); //set maximum part of screen covered
    setMaxSize(comp, maxSize);
    
    return comp.getPreferredSize();
}
 
Example 3
Project: incubator-netbeans   File: CompletionLayoutPopup.java   View Source Code Vote up 5 votes
final Dimension getPreferredSize() {
    JComponent comp = getContentComponent();

    if (comp == null) {
        return new Dimension(0, 0);
    }

    int screenWidth = Utilities.getUsableScreenBounds().width;

    Dimension maxSize = new Dimension((int) (screenWidth * MAX_COMPL_COVERAGE),
            comp.getMaximumSize().height); //set maximum part of screen covered
    setMaxSize(comp, maxSize);

    return comp.getPreferredSize();
}