Package javax.swing

Examples of javax.swing.JLayeredPane$AccessibleJLayeredPane


  @Override
  public void addNotify() {
    super.addNotify();
    // This call throws a runtime exception if the hierarchy is not compatible
    JLayeredPane layeredPane = findLayeredPane(this);
    if(embeddedPanel != null && embeddedPanel.isHiddenReparenting) {
      layeredPane.setLayer(embeddedPanel, Integer.MIN_VALUE);
      layeredPane.add(embeddedPanel);
      layeredPane.invalidate();
      layeredPane.validate();
      nativeComponentWrapper.restoreFromHiddenParent();
      embeddedPanel.isHiddenReparenting = false;
    }
    boolean isEmbeddedPanelCreated = embeddedPanel != null;
    if(isEmbeddedPanelCreated) {
      JLayeredPane oldLayeredPane = findLayeredPane(embeddedPanel);
      if(layeredPane != oldLayeredPane) {
        nativeComponentWrapper.storeInHiddenParent();
        Container oldParent = embeddedPanel.getParent();
        oldParent.remove(embeddedPanel);
        UIUtils.revalidate(oldParent);
View Full Code Here


      if(!isProxied) {
        embeddedPanel.setVisible(false);
        isProxied = true;
        try {
          // This call throws a runtime exception if the hierarchy is not compatible
          JLayeredPane layeredPane = findLayeredPane(this);
          layeredPane.setLayer(embeddedPanel, Integer.MIN_VALUE);
          // Hack to reparent without the native component to be disposed
//        layeredPane.add(embeddedPanel);
          layeredPane.setComponentZOrder(embeddedPanel, 0);
          layeredPane.revalidate();
          layeredPane.repaint();
          revalidate();
          repaint();
        } catch(RuntimeException ex) {
          super.removeNotify();
          throw ex;
View Full Code Here

                public void run() {
                    User32 user = User32.INSTANCE;
                    HWND hWnd = getHWnd(w);
                    int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof W32TransparentContentPane) {
                        ((W32TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        W32TransparentContentPane w32content =
                            new W32TransparentContentPane(content);
                        root.setContentPane(w32content);
                        lp.add(new RepaintTrigger(w32content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    if (transparent && !usingUpdateLayeredWindow(w)) {
                        flags |= User32.WS_EX_LAYERED;
                        user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
View Full Code Here

  protected static final int WIDTH = 200;
  protected static final int HEIGHT = 200;

  public static JComponent createContent() {
    JPanel contentPane = new JPanel(new BorderLayout());
    JLayeredPane layeredPane = new JLayeredPane();
    layeredPane.setOpaque(true);
    layeredPane.setBackground(new Color(200, 200, 255));
    int layerIndex = 0;
    // A flash player
    JFlashPlayer flashPlayer = new JFlashPlayer(JFlashPlayer.constrainVisibility());
    flashPlayer.setControlBarVisible(false);
    flashPlayer.load(SimpleFlashExample.class, "resource/Movement-pointer_or_click.swf");
    flashPlayer.setBounds(0, 0, 200, 200);
    layeredPane.setLayer(flashPlayer, layerIndex++);
    layeredPane.add(flashPlayer);
    // A swing panel
    JPanel swingPanel = new JPanel();
    swingPanel.setBorder(BorderFactory.createTitledBorder("Swing JPanel"));
    swingPanel.setBackground(Color.GREEN);
    swingPanel.setBounds(200, 100, WIDTH, HEIGHT);
    layeredPane.setLayer(swingPanel, layerIndex++);
    layeredPane.add(swingPanel);
    // A web browser
    JWebBrowser webBrowser = new JWebBrowser(JWebBrowser.constrainVisibility());
    webBrowser.setBarsVisible(false);
    webBrowser.setStatusBarVisible(true);
    webBrowser.setHTMLContent(
        "<html>" + LS +
        "  <body>" + LS +
        "    <h1>A web page</h1>" + LS +
        "    <p>A paragraph with a <a href=\"http://www.google.com\">link</a>.</p>" + LS +
        "  </body>" + LS +
        "</html>");
    webBrowser.setBounds(300, 250, WIDTH, HEIGHT);
    layeredPane.setLayer(webBrowser, layerIndex++);
    // A swing button
    JButton swingButton = new JButton("Swing JButton");
    swingButton.setBounds(400, 400, WIDTH, HEIGHT);
    layeredPane.setLayer(swingButton, layerIndex++);
    layeredPane.add(swingButton);
    layeredPane.add(webBrowser);
    layeredPane.setPreferredSize(new Dimension(600, 600));
    contentPane.add(new JScrollPane(layeredPane), BorderLayout.CENTER);
    return contentPane;
  }
View Full Code Here

        return;
      }
            whenDisplayable(w, new Runnable() {
                public void run() {
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof X11TransparentContentPane) {
                        ((X11TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        X11TransparentContentPane x11content =
                            new X11TransparentContentPane(content);
                        root.setContentPane(x11content);
                        lp.add(new RepaintTrigger(x11content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    setLayersTransparent(w, transparent);
                    setForceHeavyweightPopups(w, transparent);
                    setDoubleBuffered(w, !transparent);
View Full Code Here

    game = new Game();
    game.addPlayer("p1", true);
    game.addPlayer("p2", true);

    Dimension windowSize = new Dimension(600, 800);
    layeredPane = new JLayeredPane();
    getContentPane().add(layeredPane);
    layeredPane.setPreferredSize(windowSize);
    layeredPane.addMouseListener(this);
    layeredPane.addMouseMotionListener(this);
View Full Code Here

TOP

Related Classes of javax.swing.JLayeredPane$AccessibleJLayeredPane

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.