Java Rectangle Bounds setBounds(Container container, Component component, Rectangle bounds)

Here you can find the source of setBounds(Container container, Component component, Rectangle bounds)

Description

set Bounds

License

Open Source License

Declaration

public static void setBounds(Container container,
                Component component, Rectangle bounds)
        

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Component;

import java.awt.Container;

import java.awt.Rectangle;

public class Main {
    public static void setBounds(Container container, Component component,
            Rectangle bounds)/*from  w  ww.j av a 2  s .com*/
    /*      */{
        /* 3449 */if (container.getComponentOrientation().isLeftToRight()) {
            /* 3450 */component.setBounds(bounds);
            /*      */}
        /*      */else {
            /* 3453 */Rectangle r = new Rectangle(bounds);
            /* 3454 */int w = container.getWidth();
            /* 3455 */r.x = (w - (bounds.x + bounds.width));
            /* 3456 */component.setBounds(r);
            /*      */}
        /*      */}

    public static void setBounds(Container container, Component component,
            int x, int y, int width, int height)
    /*      */{
        /* 3472 */if (container.getComponentOrientation().isLeftToRight()) {
            /* 3473 */component.setBounds(x, y, width, height);
            /*      */}
        /*      */else {
            /* 3476 */int w = container.getWidth();
            /* 3477 */component.setBounds(w - x - width, y, width, height);
            /*      */}
        /*      */}
}

Related

  1. getCenteredBoundsOn(Rectangle srcBounds, int width, int height)
  2. getLocalBounds(Component aComponent)
  3. getLocalBounds(Rectangle bounds, Container c)
  4. getRectangleListBounds(Vector vctRectangles)
  5. isInCollision(Rectangle boundedBoxPlayer, Rectangle boundedBoxObject)
  6. setBounds(java.awt.Rectangle hole, int xA, int yA, int xB, int yB)
  7. storeWindowBounds(java.awt.Window window, java.util.prefs.Preferences prefs)