List of usage examples for javax.swing RootPaneContainer getContentPane
Container getContentPane();
From source file:com.diversityarrays.wizard.WizardRunner.java
protected void handleWizardEnded(WizardEndedReason reason) { if (handler != null) { handler.execute(reason);// w w w .j a v a 2s .com } status.setText(reason.toString()); WizardRunner.this.setEnabled(false); RootPaneContainer rpc = ((RootPaneContainer) window); rpc.getContentPane().remove(this); Container cp = rpc.getContentPane(); cp.removeAll(); JLabel label = new JLabel(reason.toString()); Box n = Box.createHorizontalBox(); n.add(Box.createHorizontalGlue()); n.add(label); n.add(Box.createHorizontalGlue()); cp.add(n, BorderLayout.CENTER); Box box = Box.createHorizontalBox(); box.add(Box.createHorizontalGlue()); box.add(new JButton(closeMe)); box.add(Box.createHorizontalStrut(20)); cp.add(box, BorderLayout.SOUTH); cp.setBackground(Color.LIGHT_GRAY); Dimension d = window.getSize(); ++d.width; window.setSize(d); }
From source file:com.diversityarrays.wizard.WizardRunner.java
public Window showRelativeTo(Component relativeTo) { RootPaneContainer rpc = ((RootPaneContainer) window); Container cp = rpc.getContentPane(); cp.setLayout(new BorderLayout()); cp.add(status, BorderLayout.NORTH); cp.add(this, BorderLayout.CENTER); window.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { cancel();//from w w w. java2s.c o m } }); status.setText("Active"); addWizardListener(wizardListener); window.pack(); Dimension d = window.getSize(); ++d.width; window.setSize(d); window.setLocationRelativeTo(relativeTo); window.setVisible(true); window.toFront(); return window; }
From source file:com.projity.pm.graphic.frames.StartupFactory.java
/** * Used to test restoring of workspace to simulate applet restart * @param old/* w w w.ja v a2 s.c o m*/ * @return */ public GraphicManager restart(GraphicManager old) { RootPaneContainer con = (RootPaneContainer) old.getContainer(); old.encodeWorkspace(); old.cleanUp(); con.getContentPane().removeAll(); GraphicManager g = instanceFromExistingSession((Container) con); // g.decodeWorkspace(); // System.out.println("restarted"); return g; }