Java Rectangle size(final Component component)

Here you can find the source of size(final Component component)

Description

Returns component size represented as a rectangle with zero X and Y coordinates.

License

Open Source License

Parameter

Parameter Description
component component to process

Return

component size rectangle

Declaration

public static Rectangle size(final Component component) 

Method Source Code

//package com.java2s;
/*/*from w w w . j a va  2  s.  c o m*/
 * This file is part of WebLookAndFeel library.
 *
 * WebLookAndFeel library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WebLookAndFeel library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with WebLookAndFeel library.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.awt.*;

public class Main {
    /**
     * Returns component size represented as a rectangle with zero X and Y coordinates.
     *
     * @param component component to process
     * @return component size rectangle
     */
    public static Rectangle size(final Component component) {
        return new Rectangle(0, 0, component.getWidth(), component.getHeight());
    }
}

Related

  1. rectDistance(final Rectangle r, final Rectangle q)
  2. rectFromArray(Rectangle2D aRectangle, double[] pts)
  3. rectFromRect2D(Rectangle2D rect)
  4. resetPosition(Window window1, Window window2)
  5. right(Rectangle r)
  6. subdivide(Dimension dimension, int threshold, int max)
  7. subdivideRectangle(int width, int height, int numTilesX, int numTilesY, int extraBorder)
  8. subtractInsets(Rectangle base, Insets insets)
  9. subtractInto(Insets i1, Rectangle r2)