javax.swing.JInternalFrame.setBounds()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中javax.swing.JInternalFrame.setBounds()方法的一些代码示例,展示了JInternalFrame.setBounds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JInternalFrame.setBounds()方法的具体详情如下:
包路径:javax.swing.JInternalFrame
类名称:JInternalFrame
方法名:setBounds

JInternalFrame.setBounds介绍

暂无

代码示例

代码示例来源:origin: pentaho/mondrian

? wh
  : desktopH - y);
sf.setBounds(x, y, sfwidth, sfheight);
x += sfwidth;

代码示例来源:origin: pentaho/mondrian

int width = (screenSize.width / 2) - (aboutW / 2);
int height = (screenSize.height / 2) - (aboutH / 2) - 100;
jf.setBounds(width, height, aboutW, aboutH);
jf.setClosable(true);

代码示例来源:origin: magefree/mage

@Override
public void deiconifyFrame(JInternalFrame f) {
  super.deiconifyFrame(f);
  if (f instanceof CardInfoWindowDialog) {
    JInternalFrame.JDesktopIcon icon = f.getDesktopIcon();
    f.setBounds(icon.getX() + (DESKTOP_ICON_WIDTH - f.getWidth()), icon.getY(), f.getWidth(), f.getHeight());
  }
}

代码示例来源:origin: pentaho/mondrian

jf.setBounds(0, 0, 500, 480);
jf.setClosable(true);
jf.setIconifiable(true);

代码示例来源:origin: pentaho/mondrian

jf.setBounds(0, 0, 500, 480);
jf.setClosable(true);
jf.setIconifiable(true);

代码示例来源:origin: pentaho/mondrian

schemaFrame.setBounds(0, 0, 1000, 650);
schemaFrame.setClosable(true);
schemaFrame.setIconifiable(true);

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void setConstraints(Object... constraints) {
  if (constraints.length > 0) {
    if (constraints[0] instanceof Point) {
      internalFrame.setLocation((Point) constraints[0]);
    } else if (constraints[0] instanceof Rectangle) {
      internalFrame.setBounds((Rectangle) constraints[0]);
    }
  }
}

代码示例来源:origin: org.cytoscape/swing-application-impl

@Override
public void setBounds (CyNetworkView view, Rectangle bounds) {
  try {
    JInternalFrame frame = viewManager.getInternalFrame(view);
    if (frame == null)
      return;
    frame.setBounds(bounds);
  } catch (Exception e) {
    return;
  }    
}

代码示例来源:origin: stackoverflow.com

//JDesktopPane desktop = new JDesktopPane();
JInternalFrame internalFrame = new JInternalFrame("PDFAnnotation" + index, true, true, true, true);

internalFrame.setBounds(0, 0, 600, 100);

desktop.add(internalFrame);

PDFPanel p = new PDFPanel();
JPanel e = p.getJPanel();
internalFrame.add(e, BorderLayout.CENTER);
internalFrame.setVisible(true);
//this.add(desktop, BorderLayout.CENTER);

代码示例来源:origin: senbox-org/snap-desktop

@Override
  public void actionPerformed(ActionEvent e) {
    int desktopWidth = desktopPane.getWidth();
    int desktopHeight = desktopPane.getHeight();
    int windowCount = frameToTabMap.size();
    int windowWidth = desktopWidth / windowCount;
    List<TabData> tabs = tabbedContainer.getModel().getTabs();
    for (int windowIndex = 0; windowIndex < windowCount; windowIndex++) {
      TabData tab = tabs.get(windowIndex);
      JInternalFrame internalFrame = tabToFrameMap.get(tab);
      internalFrame.setBounds(windowIndex * windowWidth, 0, windowWidth, desktopHeight);
    }
  }
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
  public void actionPerformed(ActionEvent e) {
    int desktopWidth = desktopPane.getWidth();
    int desktopHeight = desktopPane.getHeight();
    int windowCount = frameToTabMap.size();
    int windowHeight = desktopHeight / windowCount;
    List<TabData> tabs = tabbedContainer.getModel().getTabs();
    for (int windowIndex = 0; windowIndex < windowCount; windowIndex++) {
      TabData tab = tabs.get(windowIndex);
      JInternalFrame internalFrame = tabToFrameMap.get(tab);
      internalFrame.setBounds(0, windowIndex * windowHeight, desktopWidth, windowHeight);
    }
  }
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
  public void actionPerformed(ActionEvent e) {
    int desktopWidth = desktopPane.getWidth();
    int desktopHeight = desktopPane.getHeight();
    JInternalFrame[] internalFrames = desktopPane.getAllFrames();
    for (JInternalFrame internalFrame : internalFrames) {
      internalFrame.setBounds(0, 0, desktopWidth, desktopHeight);
    }
  }
}

代码示例来源:origin: org.solovyev/common-other

public static <T extends Number> JInternalFrame drawMatrix(int startX, int startY, int width, int height, String title, Color color, Matrix<T>... matrixes) {
  JInternalFrame jInternalFrame = new JInternalFrame(title, true, true, true, true);
  jInternalFrame.setBackground(Color.white);
  jInternalFrame.getContentPane().add(new PaintPanel<T>(startX, startY, width, height, color, matrixes));
  jInternalFrame.setBounds(0, 0,
      width + startX * 2 + 20,
      height + startY * 2 + 40);
  jInternalFrame.setVisible(true);
  return jInternalFrame;
}

代码示例来源:origin: stackoverflow.com

JInternalFrame frmUpdateData = null;
 frmUpdateData = new JInternalFrame("Test", true, true);
 frmUpdateData.setBounds(0, 0, 200, 200);
 JDesktopPane desktopPane = new JDesktopPane();
 desktopPane.setBounds(0, 0, 600, 600);
 desktopPane.add(frmUpdateData);
 desktopPane.setVisible(true);
 frmUpdateData.setVisible(true);
 JFrame frame = new JFrame();
 frame.setBounds(0, 0, 600, 600);
 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 frame.getContentPane().add(desktopPane);
 frame.setVisible(true);
 while (frmUpdateData != null && !frmUpdateData.isClosed()) {
   try {
     Thread.sleep(100);
   } catch (InterruptedException e) {
     e.printStackTrace();
   }
 }
 JOptionPane.showMessageDialog(null, "Done");

代码示例来源:origin: bcdev/beam

public void tileFramesVertically(final JDesktopPane desktopPane, final JInternalFrame[] frames) {
  if (frames.length == 0) {
    return;
  }
  final int widthTot = desktopPane.getWidth();
  final int heightTot = desktopPane.getHeight();
  int y = 0;
  final int n = frames.length;
  for (int i = 0; i < n; i++) {
    int h = heightTot / n;
    if (i == n - 1) {
      h = heightTot - h * (n - 1);
    }
    try {
      frames[i].setMaximum(false);
    } catch (PropertyVetoException e) {
      //ignore
    }
    frames[i].setBounds(0, y, widthTot, h);
    y += h;
  }
}

代码示例来源:origin: bcdev/beam

public void tileFramesHorizontally(final JDesktopPane desktopPane, final JInternalFrame[] frames) {
  if (frames.length == 0) {
    return;
  }
  final int widthTot = desktopPane.getWidth();
  final int heightTot = desktopPane.getHeight();
  int x = 0;
  final int n = frames.length;
  for (int i = 0; i < n; i++) {
    int w = widthTot / n;
    if (i == n - 1) {
      w = widthTot - w * (n - 1);
    }
    try {
      frames[i].setMaximum(false);
    } catch (PropertyVetoException e) {
      //ignore
    }
    frames[i].setBounds(x, 0, w, heightTot);
    x += w;
  }
}

代码示例来源:origin: stackoverflow.com

class testDialog {

  public static void main(String[] args) {
   JDialog d = new JDialog();
   JDesktopPane desktoppane = new JDesktopPane(); // added
   desktoppane.setPreferredSize(new Dimension(100, 100));// added
   JInternalFrame i = new JInternalFrame("HI", false, false, false, false);
   // i.setPreferredSize(new Dimension(100, 100));
   i.setBounds(0, 0, 100, 100);// added
   desktoppane.add(i);
   i.setVisible(true);

   d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
   d.setTitle("Wait dialog");
   // d.add(i);
   d.add(desktoppane); // added
   d.pack();
   // d.setPreferredSize(new Dimension(100, 100));
   d.setLocation(300, 300);
   d.setAlwaysOnTop(true);
   d.setVisible(true);
  }
}

代码示例来源:origin: khuxtable/seaglass

public void componentResized(ComponentEvent e) {
    if (frame != null && frame.isMaximum()) {
      JDesktopPane desktop = (JDesktopPane) e.getSource();
      for (Component comp : desktop.getComponents()) {
        if (comp instanceof SeaGlassDesktopPaneUI.TaskBar) {
          frame.setBounds(0, 0, desktop.getWidth(), desktop.getHeight() - comp.getHeight());
          frame.revalidate();
          break;
        }
      }
    }
    // Update the new parent bounds for next resize, but don't
    // let the super method touch this frame
    JInternalFrame f = frame;
    frame = null;
    super.componentResized(e);
    frame = f;
  }
};

代码示例来源:origin: net.sf.squirrel-sql.plugins/graph

@Override
public void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight)
{
 if (f instanceof TableFrame)
 {
   TableFrame tf = (TableFrame) f;
   if (!_graphDesktopPane.isGroupFrame(tf))
   {
    _graphDesktopPane.setGroupFrame(tf);
   }
   Point delta = new Point(newX - f.getX(), newY - f.getY());
   for (JInternalFrame current : _graphDesktopPane.getGroupFrames())
   {
    if (current != f)
    {
      current.setBounds(current.getX() + delta.x, current.getY() + delta.y, newWidth, newHeight);
    }
   }
 }
 super.resizeFrame(f, newX, newY, newWidth, newHeight);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

/**
 * Sets the Shaded attribute of the InternalFrameWindow object
 * 
 * @param b The new Shaded value
 */
public void setShaded(boolean b) {
 if (b == shaded) { return; }
 if (b == true) {
  Rectangle bounds = frame.getBounds();
  Rectangle p = new Rectangle(bounds.x, bounds.y, bounds.width,
    bounds.height);
  frame.putClientProperty(SHADE_BOUNDS_PROPERTY, p);
  frame.setBounds(p.x, p.y, p.width, frame.getMinimumSize().height - 2);
 } else {
  Point location = frame.getLocation();
  Rectangle p = (Rectangle)frame.getClientProperty(SHADE_BOUNDS_PROPERTY);
  frame.getDesktopPane().getDesktopManager().setBoundsForFrame(frame,
    location.x, location.y, p.width, p.height);
  frame.putClientProperty(SHADE_BOUNDS_PROPERTY, null);
 }
 shaded = b;
}

相关文章

JInternalFrame类方法