Package javax.swing

Examples of javax.swing.JDesktopPane$ComponentPosition


    assertThat(desktopPane).isNull();
  }

  @RunsInEDT
  private static JDesktopPane setNullIconAndReturnDesktopPane(final JInternalFrame internalFrame) {
    JDesktopPane desktopPane = execute(new GuiQuery<JDesktopPane>() {
      @Override
      protected JDesktopPane executeInEDT() {
        internalFrame.setDesktopIcon(null);
        return JInternalFrameDesktopPaneQuery.desktopPaneOf(internalFrame);
      }
View Full Code Here


    return desktopPane;
  }

  @Test
  public void should_return_JDesktopPane_from_JDesktopIcon() {
    JDesktopPane desktopPane = desktopPaneOf(internalFrame);
    assertThat(desktopPane).isSameAs(window.desktop());
  }
View Full Code Here

    setChatPanels(new JPanel());
    getContentPane().add(getChatPanels(), BorderLayout.CENTER);
    getChatPanels().setLayout(new BorderLayout(0, 0));

    chatDesk = new JDesktopPane();
    chatDesk.setFocusable(false);
    chatDesk.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    getChatPanels().add(chatDesk);

    chatDesk.setLayout(null);
View Full Code Here

   */
  private void init() {
    BorderLayout thisLayout = new BorderLayout();
    this.setLayout(thisLayout);
    setPreferredSize(new Dimension(400, 300));
    desktopPane = new JDesktopPane();
    desktopPane.setBackground(Color.LIGHT_GRAY);
    this.add(desktopPane, BorderLayout.CENTER);
  }
View Full Code Here

        int dy=(int)(h*p/100);
        int y=(int)(h-dy)/2;
        //System.out.println("x="+x+",y="+y+",dx="+dx+",dy="+dy);
        setBounds(x, y,dx,dy);
     
        desktop = new JDesktopPane();
       
        createControlButtons();
       
        setContentPane(desktop);
       
View Full Code Here

        super("");
        enableEvents(AWTEvent.KEY_EVENT_MASK);
        setSize(screenSize);
        setFocusCycleRoot(true);
        setFocusTraversalPolicy(new DefaultFocusTraversalPolicy());
        desktop = new JDesktopPane() {
            private static final long serialVersionUID = 1L;
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                if (backgroundImage != null) {
                    Dimension ds = desktop.getSize();
View Full Code Here

     * Add this window to the desktop.
     */
    protected final void addToDesktop() {
        Runnable run = new Runnable() {
            public void run() {
                final JDesktopPane desktop = toolkit.getAwtContext().getDesktop();
                desktop.add(peerComponent);
                try {
                    peerComponent.setSelected(true);
                    desktop.getDesktopManager().activateFrame(peerComponent);
                    peerComponent.toFront();
                    desktop.doLayout();
                } catch (PropertyVetoException x) {
                    log.warn("", x);
                }
            }
        };

        final JDesktopPane desktop = toolkit.getAwtContext().getDesktop();
        AppContext ac = SunToolkit.targetToAppContext(desktop);
        if (ac != null) {
            EventQueue eq = (EventQueue) ac.get(AppContext.EVENT_QUEUE_KEY);
            if (eq != null) {
                eq.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(), run));
View Full Code Here

        Component root = awtc.getTopLevelRootComponent();
        if (root == null)
            return super.getScreenInsets(gc);

        JDesktopPane jdp = awtc.getDesktop();
        if (jdp == null)
            return super.getScreenInsets(gc);

        Rectangle trc_bounds = root.getBounds();
        Point jdp_loc = jdp.getLocationOnScreen();
        Rectangle jdp_bounds = jdp.getBounds();

        return new Insets(jdp_loc.y, jdp_loc.x, trc_bounds.height - jdp_loc.y - jdp_bounds.height,
            trc_bounds.width - jdp_loc.x - jdp_bounds.width);
    }
View Full Code Here

    frame.setClosable(false);
    frame.setVisible(true);
    frame.setContentPane(content);
    frame.pack();

    final JDesktopPane desktop = new JDesktopPane();
    desktop.setDoubleBuffered(false);
    desktop.add(frame);
    return desktop;
  }
View Full Code Here

  {
    setTitle("InternalFrameDemo");

    setJMenuBar(createMenuBar());

    desktop = new JDesktopPane();
    setContentPane(desktop);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JDesktopPane$ComponentPosition

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.