コード例 #1
0
 /**
  * Gets the bounds of this embedded frame as a rectangle specifying the width, height and location
  * relative to the native parent component.
  *
  * <p>setLocation() and setBounds() for EmbeddedFrame really don't move it within the native
  * parent. These methods always put embedded frame to (0, 0) for backward compatibility. To allow
  * getting location and size of embedded frames getLocationPrivate() and getBoundsPrivate() were
  * introduced, and they work just the same way as getLocation() and getBounds() for ususal,
  * non-embedded components.
  *
  * <p>Using usual get/setLocation() and get/setBounds() together with new get/setLocationPrivate()
  * and get/setBoundsPrivate() is not recommended. For example, calling getBoundsPrivate() after
  * setLocation() works fine, but getBounds() after setBoundsPrivate() may return unpredictable
  * value.
  *
  * @return a rectangle indicating this embedded frame's bounds
  * @see java.awt.Component#getBounds
  * @see #setLocationPrivate
  * @see #getLocationPrivate
  * @see #setBoundsPrivate
  * @since 1.6
  */
 protected Rectangle getBoundsPrivate() {
   final FramePeer peer = (FramePeer) getPeer();
   if (peer != null) {
     return peer.getBoundsPrivate();
   } else {
     return getBounds();
   }
 }
コード例 #2
0
 protected void setBoundsPrivate(int x, int y, int width, int height) {
   final FramePeer peer = (FramePeer) getPeer();
   if (peer != null) {
     peer.setBoundsPrivate(x, y, width, height);
   }
 }