Package javax.swing

Examples of javax.swing.JDesktopPane$ComponentPosition


    @Override
    protected void setUp() throws Exception {
        super.setUp();
        frame = new JFrame();
        desktop = new JDesktopPane();
        ui = new BasicDesktopPaneUI();
        desktop.setUI(ui);
        iframe1 = new JInternalFrame("", true, true, true, true);
        desktop.add(iframe1);
        iframe2 = new JInternalFrame("", true, true, true, true);
View Full Code Here


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new JPanel();
        jDesktopPane1 = new JDesktopPane();
        jPanel1 = new JPanel();
        jSplitPane1 = new JSplitPane();
        jTabbedPane1 = new JTabbedPane();
        jPanel2 = new JPanel();
        jPanel4 = new JPanel();
View Full Code Here

        setStatusBar(statusPanel);
        setToolBar(jToolBar1);
    }// </editor-fold>//GEN-END:initComponents

    private void changeSize(ComponentEvent evt) {//GEN-FIRST:event_changeSize
        JDesktopPane j = (JDesktopPane) evt.getSource();
        jPanel1.setSize(j.getSize());
        jPanel1.updateUI();
        jPanel1.validate();
    }//GEN-LAST:event_changeSize
View Full Code Here

      return;
    }

    try
    {
      JDesktopPane frame = ((AktarioGUI) Client.instance().getClientGUI()).getDesktopPane();

      Properties props = new Properties();

      props.put("closable", false);
      props.put("iconifiable", false);
View Full Code Here

      }
    }

    public void closeFrame(JInternalFrame frame) {
      Component child = getChild(frame);
    JDesktopPane parent = (JDesktopPane)child.getParent();
    if (parent == null) {
      return;
    }
      selectNextFrame(frame);
        if (parent != null) {
            parent.remove(child);
        }
        removeIcon(frame);
        if (parent.getAllFrames().length == 0) {
          parent.requestFocus();
        }
    }
View Full Code Here

    }
    frame.restoreSubcomponentFocus();
    }
   
    private JInternalFrame getNextFrame(JInternalFrame frame) {
      JDesktopPane desktop = frame.getDesktopPane();
      JInternalFrame[] frames = desktop.getAllFrames();
      boolean found = false;
      for (JInternalFrame f: frames) {
        if (found) {
          return f;
        }
View Full Code Here

    layout.minimizeLayoutComponent(child);
    }

    public void iconifyFrame(JInternalFrame frame) {
        JDesktopIcon icon = frame.getDesktopIcon();
        JDesktopPane desktop = frame.getDesktopPane();
        DockLayout layout = (DockLayout)desktop.getLayout();
        if (frame.isMaximum()) {
          layout.minimizeLayoutComponent(frame);
        }
        if (frame.isSelected()) {
          selectNextFrame(frame);
        }
        frame.setVisible(false);
        desktop.add(icon);
    }
View Full Code Here

        setSelected(frame);
    }

    public void activateFrame(JInternalFrame frame) {
      Component child = getChild(frame);
      JDesktopPane parent = (JDesktopPane)child.getParent();
      JInternalFrame currentlyActiveFrame = parent == null? null: parent.getSelectedFrame();
      if (parent == null) {
        parent = (JDesktopPane)getChild(frame.getDesktopIcon()).getParent();
        if (parent == null) {
          return;
        }
      }
      if (currentlyActiveFrame == null) {
        if (parent != null) {
          parent.setSelectedFrame(frame);
        }
      } else if (currentlyActiveFrame != frame) { 
        if (currentlyActiveFrame.isSelected()) {
          try {
            currentlyActiveFrame.setSelected(false);
          } catch(PropertyVetoException ignore) {
          }
        }
        if (parent != null) {
          parent.setSelectedFrame(frame);
        }
      }
      frame.moveToFront();
    }
View Full Code Here

      }
      frame.moveToFront();
    }
   
    public void deactivateFrame(JInternalFrame frame) {
      JDesktopPane desktop = frame.getDesktopPane();
      JInternalFrame currentlyActiveFrame = desktop == null? null: desktop.getSelectedFrame();
      if (currentlyActiveFrame == frame) {
        desktop.setSelectedFrame(null);
      }
    }
View Full Code Here

      drawBounds(frame);
      moveFrame(frame, dragBounds.x + dragBounds.width / 2, dragBounds.y + dragBounds.height / 2);
    }
   
    public void moveFrame(JComponent frame, int newX, int newY) {
    JDesktopPane desktop = getDesktopPane(frame);
    LayoutManager2 layoutManager = (LayoutManager2)desktop.getLayout();
    Component componentToDock = desktop.getComponentAt(newX, newY);
    if (componentToDock != null && componentToDock != frame) {
      layoutManager.addLayoutComponent(frame, new DockConstraints(componentToDock, getDockLocation(componentToDock, newX, newY)));
      layoutManager.layoutContainer(desktop);
    }
    if (frame instanceof JInternalFrame) {
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.