? wh : desktopH - y); sf.setBounds(x, y, sfwidth, sfheight); x += sfwidth;
int width = (screenSize.width / 2) - (aboutW / 2); int height = (screenSize.height / 2) - (aboutH / 2) - 100; jf.setBounds(width, height, aboutW, aboutH); jf.setClosable(true);
@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()); } }
jf.setBounds(0, 0, 500, 480); jf.setClosable(true); jf.setIconifiable(true);
jf.setBounds(0, 0, 500, 480); jf.setClosable(true); jf.setIconifiable(true);
schemaFrame.setBounds(0, 0, 1000, 650); schemaFrame.setClosable(true); schemaFrame.setIconifiable(true);
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]); } } }
@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; } }
//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);
@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); } } }
@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); } } }
@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); } } }
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; }
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");
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; } }
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; } }
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); } }
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; } };
@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); }
/** * 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; }