public static void main(String args[]) { SwingUtilities.invokeLater(() -> { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); JDesktopPane desktopPane = new JDesktopPane(); DesktopManager dm = new MageDesktopManager(); desktopPane.setDesktopManager(dm); JInternalFrame internalFrame = new JInternalFrame("Test Internal Frame", true, false, true, true); internalFrame.setSize(200, 150); internalFrame.setVisible(true); desktopPane.add(internalFrame); frame.add(desktopPane, BorderLayout.CENTER); frame.setSize(800, 600); frame.setVisible(true); }); } }
@Override public void setVisible(boolean value) { super.setVisible(value); if (value) { this.toFront(); } if (modal) { this.setClosable(false); if (value) { startModal(); } else if (SwingUtilities.isEventDispatchThread()) { stopModal(); } else { try { SwingUtilities.invokeAndWait(() -> stopModal()); } catch (InterruptedException ex) { LOGGER.fatal("MageDialog error", ex); } catch (InvocationTargetException ex) { LOGGER.fatal("MageDialog error", ex); } } } }
jf.setVisible(true); jf.show(); } catch (Exception ex) {
jf.setMaximizable(true); jf.setResizable(true); jf.setVisible(true); jf.setVisible(true); jf.show();
jf.setMaximizable(true); jf.setResizable(true); jf.setVisible(true);
if (frame.getTitle().equals("Waiting for players")) { frame.toFront(); frame.setVisible(true); try { frame.setSelected(true);
schemaFrame.setMaximizable(true); schemaFrame.setResizable(true); schemaFrame.setVisible(true);
@Override public void run() { JInternalFrame window = createInternalFrame(owner, pane); window.setVisible(true); } };
@Override public void setVisible(boolean aFlag) { super.setVisible(aFlag); if(null != _widget) { _widget.setVisible(aFlag); } }
@Override public void run() { JInternalFrame window = createInternalFrame(owner, pane); window.setVisible(true); } };
public void run() { JInternalFrame window = createInternalFrame(owner, pane); window.setVisible(true); } };
@Override public Result prompt() { dialog.setVisible(true); final Object value = pane.getValue(); dialog.dispose(); return resultMap.get(value); }
private void setFrames(SampleNode samples, String fileName) throws IOException { JInternalFrame frame = new StackDumpJInternalFrame(samples, fileName, false); frame.setVisible(true); desktopPane.add(frame, javax.swing.JLayeredPane.DEFAULT_LAYER); }
@Override public void setVisible(final boolean value) { super.setVisible(value); if (value) { startModal(); } else { stopModal(); } }
//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);
private int count; desktop.add(createInternalFrame(++count)); private JInternalFrame createInternalFrame(int number) { JInternalFrame jif = new JInternalFrame( "F" + number, true, true, true, false); int topLeft = 25 * number; jif.add(new JTextField(String.valueOf(number), 8)); jif.pack(); jif.setLocation(topLeft, topLeft); jif.setVisible(true); return jif; }
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; }
/** * Workaround for bug: can't re-show internal frames. See bug parade 4138031. */ public static void show(JInternalFrame internalFrame, JDesktopPane desktopPane) throws PropertyVetoException { if (!desktopPane.isAncestorOf(internalFrame)) desktopPane.add(internalFrame); internalFrame.setClosed(false); internalFrame.setVisible(true); internalFrame.toFront(); }
JDesktopPane mainPanel; JInternalFrame jif_test = new JInternalFrame(); public void centerJIF(JInternalFrame jif) { Dimension desktopSize = mainPanel.getSize(); Dimension jInternalFrameSize = jif.getSize(); int width = (desktopSize.width - jInternalFrameSize.width) / 2; int height = (desktopSize.height - jInternalFrameSize.height) / 2; jif.setLocation(width, height); jif.setVisible(true); }
asd t = new asd(); JInternalFrame internalFrame = new JInternalFrame(); internalFrame.setContentPane(t.getContentPane()); internalFrame.pack(); // set the internalFrame's location // ... internalFrame.setVisible(true); dskp.add(internalFrame);