Package javax.swing

Examples of javax.swing.JRootPane$AccessibleJRootPane


    return new JFrame();
  }

  @Override
  public Component cloneWidget() {
    JRootPane jrp = new JRootPane();
    JFrame jframe = (JFrame) getWidget();
    JMenuBar jmb = jframe.getJMenuBar();
    if (jmb != null) {
      WidgetAdapter jmbAdapter = WidgetAdapter.getWidgetAdapter(jmb);
      JMenuBar jmenubar = (JMenuBar) jmbAdapter.cloneWidget();
      jrp.setJMenuBar(jmenubar);
    }
    Container container = (Container) contentAdapter.cloneWidget();
    jrp.setContentPane(container);
    return jrp;
  }
View Full Code Here


    JavaUtil.hideMenu();
    Component contentComponent = rootAdapter.cloneWidget();
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    if (contentComponent instanceof JRootPane) {
      JRootPane jrp = (JRootPane) contentComponent;
      JMenuBar jmb = jrp.getJMenuBar();
      if (jmb != null) {
        frame.setJMenuBar(jmb);
      }
      Container contentPane = jrp.getContentPane();
      Dimension size = rootAdapter.getParentContainer().getSize();
      contentPane.setPreferredSize(size);
      frame.setContentPane(contentPane);
    } else {
      contentComponent.setPreferredSize(rootAdapter.getParentContainer()
View Full Code Here

    private class ToplevelPanel extends JApplet {
    private static final long serialVersionUID = 1L;

    // Overridden from JApplet.
        protected JRootPane createRootPane() {
            JRootPane rootPane = new ToplevelRootPane();
            rootPane.setOpaque(true);
            return rootPane;
        }
View Full Code Here

  }

  protected void attach() {
    if (widget != null) {
      if (widget instanceof RootPaneContainer) {
        JRootPane jrootPane = ((RootPaneContainer) widget).getRootPane();
        jrootPane.putClientProperty(ADAPTER_PROPERTY, this);
      } else if (widget instanceof JComponent) {
        ((JComponent) widget).putClientProperty(ADAPTER_PROPERTY, this);
      }
    }
  }
View Full Code Here

        return  new Dimension(Math.max(layoutSize.width, minimumSize.width),
                              Math.max(layoutSize.height, minimumSize.height));
    }

    public void selectInitialValue(final JOptionPane op) {
        JRootPane rootPane = op.getRootPane();
        if (rootPane != null && initialFocusComponent instanceof JButton) {
            rootPane.setDefaultButton((JButton)initialFocusComponent);
        }

        JComponent focusOwner = (inputComponent != null) ? inputComponent
                : ((initialFocusComponent instanceof JComponent)
                        ? (JComponent)initialFocusComponent : null);
View Full Code Here

        super(frame, title, modal);
    }
   
    @Override
    protected JRootPane createRootPane() {
        JRootPane rootPane = new JRootPane();
        Action escapeAction = new AbstractAction("ESCAPE") {   
            /**
             *
             */
            private static final long serialVersionUID = 2208129319916921772L;

            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
            }
        };
        InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(KeyStrokes.ESC, escapeAction.getValue(Action.NAME));
        rootPane.getActionMap().put(escapeAction.getValue(Action.NAME), escapeAction);
        return rootPane;
    }
View Full Code Here

        init();
    }

    @Override
    protected JRootPane createRootPane() {
        JRootPane rootPane = new JRootPane();
        // Hide Window on ESC
        Action escapeAction = new AbstractAction("ESCAPE") {
            /**
             *
             */
            private static final long serialVersionUID = -6543764044868772971L;

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                setVisible(false);
            }
        };
        // Do search on Enter
        Action enterAction = new AbstractAction("ENTER") {
            /**
             *
             */
            private static final long serialVersionUID = -3661361497864527363L;

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                doSearch(actionEvent);
            }
        };
        ActionMap actionMap = rootPane.getActionMap();
        actionMap.put(escapeAction.getValue(Action.NAME), escapeAction);
        actionMap.put(enterAction.getValue(Action.NAME), enterAction);
        InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(KeyStrokes.ESC, escapeAction.getValue(Action.NAME));
        inputMap.put(KeyStrokes.ENTER, enterAction.getValue(Action.NAME));

        return rootPane;
    }
View Full Code Here

    /**
     * Allow Dialog to be closed by ESC key
     */
    @Override
    protected JRootPane createRootPane() {
        JRootPane rootPane = new JRootPane();
        KeyStroke stroke = KeyStrokes.ESC;
        javax.swing.Action escapeAction = new AbstractAction("ESCAPE") {
            /**
             *
             */
            private static final long serialVersionUID = -4036804004190858925L;

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                setVisible(false);
            }
        };
        rootPane.getActionMap().put(escapeAction.getValue(Action.NAME), escapeAction);
        InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(stroke, escapeAction.getValue(Action.NAME));
        return rootPane;
    }
View Full Code Here

        init();
    }

    @Override
    protected JRootPane createRootPane() {
        JRootPane rootPane = new JRootPane();
        // Hide Window on ESC
        Action escapeAction = new AbstractAction("ESCAPE") {
            /**
             *
             */
            private static final long serialVersionUID = -8699034338969407625L;

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                setVisible(false);
            }
        };
        // Do update on Enter
        Action enterAction = new AbstractAction("ENTER") {
            /**
             *
             */
            private static final long serialVersionUID = -1529005452976176873L;

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                doUpdate(actionEvent);
                setVisible(false);
            }
        };
        ActionMap actionMap = rootPane.getActionMap();
        actionMap.put(escapeAction.getValue(Action.NAME), escapeAction);
        actionMap.put(enterAction.getValue(Action.NAME), enterAction);
        InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(KeyStrokes.ESC, escapeAction.getValue(Action.NAME));
        inputMap.put(KeyStrokes.ENTER, enterAction.getValue(Action.NAME));
        return rootPane;
    }
View Full Code Here

        init();
    }

    @Override
    protected JRootPane createRootPane() {
        JRootPane rootPane = new JRootPane();
        // Hide Window on ESC
        Action escapeAction = new AbstractAction("ESCAPE") { //$NON-NLS-1$
            /**
             *
             */
            private static final long serialVersionUID = -6543764044868772971L;

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                setVisible(false);
            }
        };
        // Do search on Enter
        Action enterAction = new AbstractAction("ENTER") { //$NON-NLS-1$

            private static final long serialVersionUID = -3661361497864527363L;

            @Override
            public void actionPerformed(final ActionEvent actionEvent) {
                checkDirtyAndLoad(actionEvent);
            }
        };
        ActionMap actionMap = rootPane.getActionMap();
        actionMap.put(escapeAction.getValue(Action.NAME), escapeAction);
        actionMap.put(enterAction.getValue(Action.NAME), enterAction);
        InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(KeyStrokes.ESC, escapeAction.getValue(Action.NAME));
        inputMap.put(KeyStrokes.ENTER, enterAction.getValue(Action.NAME));

        return rootPane;
    }
View Full Code Here

TOP

Related Classes of javax.swing.JRootPane$AccessibleJRootPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.