Example usage for javax.swing JTabbedPane getSize

List of usage examples for javax.swing JTabbedPane getSize

Introduction

In this page you can find the example usage for javax.swing JTabbedPane getSize.

Prototype

public Dimension getSize() 

Source Link

Document

Returns the size of this component in the form of a Dimension object.

Usage

From source file:edu.ku.brc.specify.tasks.subpane.lm.LifeMapperPane.java

/**
 * @return/* ww w  . ja  v a2 s  .  co m*/
 */
private int getCurrentSizeSquare() {
    int maxHeight = MAP_HEIGHT;
    int maxWidth = MAP_WIDTH;
    if (SubPaneMgr.getInstance() instanceof JTabbedPane) {
        Dimension size;
        JTabbedPane tbPane = (JTabbedPane) SubPaneMgr.getInstance();
        if (tbPane.getTabCount() > 0) {
            size = tbPane.getComponentAt(0).getSize();
        } else {
            size = tbPane.getSize();
            size.height -= 30;
        }
        int lblHeight = (UIHelper.createLabel(" ").getPreferredSize().height) * 5;
        maxHeight = size.height - lblHeight - IMG_HEIGHT - 30;
        maxWidth = size.width - 20;
    }
    return Math.min(maxHeight, maxWidth);
}