Java JComponent Container getActiveRectangle(JComponent c)

Here you can find the source of getActiveRectangle(JComponent c)

Description

get Active Rectangle

License

Apache License

Declaration

public static Rectangle getActiveRectangle(JComponent c) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import javax.swing.*;

import java.awt.*;

public class Main {
    public static Rectangle getActiveRectangle(JComponent c) {
        Dimension d = c.getSize();
        Insets ins = c.getInsets();
        int left = ins.left;
        int width = d.width - ins.right - ins.left;
        int top = ins.top;
        int height = d.height - ins.bottom - ins.top;
        Rectangle ret = new Rectangle(left, top, width, height);
        return ret;

    }/*from ww  w  .ja  v a  2 s  .  c  o  m*/
}

Related

  1. findMainRootPane(Component component)
  2. findRootPane(Component component)
  3. findRootPaneContainer(Component c)
  4. findRootPaneContainer(Component root)
  5. findRootPaneContainer(final Component source)
  6. getAllJComponents(Container container, Collection collection)
  7. getAncestorOfType(JComponent component, Class type)
  8. getAncestorsOfClass(JComponent start, Class theClass)
  9. getBooleanClientProperty(JComponent c, Object property)