Java Code Examples for javax.swing.JInternalFrame#getBounds()

The following examples show how to use javax.swing.JInternalFrame#getBounds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InternalFrameDemoFrame.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Handler method called by the preview action. This method should perform all operations to preview the report.
 */
protected void attemptPreview()
{
  final JInternalFrame frame = findSelectedFrame();
  if (frame == null)
  {
    return;
  }
  final Rectangle bounds = frame.getBounds();
  final Container parent = frame.getParent();
  final boolean visible = frame.isVisible();
  final int layer = frame.getLayer();

  // now print ..
  previewReport(frame);

  if (parent != null)
  {
    if (frame.getParent() != parent)
    {
      frame.getParent().remove(frame);
      parent.add(frame);
    }
  }
  frame.setBounds(bounds);
  frame.setVisible(visible);
  frame.setLayer(new Integer(layer));
}
 
Example 2
Source File: Preferences.java    From pdfxtk with Apache License 2.0 4 votes vote down vote up
void grab(boolean grabPosition, JInternalFrame frame) {
  icon      = frame.isIcon();
  showing   = frame.isVisible();
  maximized = frame.isMaximum();
  if(!icon && !maximized) bounds = frame.getBounds();
}