Package java.awt

Examples of java.awt.Dimension


    getRootPane().setDefaultButton(okButton);

    pack();

    if (getSize().width < 600) {
      Dimension dim = getSize();
      dim.width = 600;
      setSize(dim);
    }

    if (getSize().height < 300) {
      Dimension dim = getSize();
      dim.height = 300;
      setSize(dim);
    }

    keysReleased();
View Full Code Here


    JPanel buttonPanel = new JPanel();
    buttonPanel.add(close);
    close.addActionListener(myListener);

    Container contents = getContentPane();
    tabbedPane.setPreferredSize(new Dimension(450, 300));
    contents.add(tabbedPane, BorderLayout.CENTER);
    contents.add(buttonPanel, BorderLayout.SOUTH);

    LocaleManager.addLocaleListener(myListener);
    myListener.localeChanged();
View Full Code Here

    selection = new Selection();
   
    addMouseListener(listener);
    addMouseMotionListener(listener);
    addKeyListener(listener);
    setPreferredSize(new Dimension(200, 200));
  }
View Full Code Here

    westPn.add(new JLabel(mLocalizer.msg("description", "Description:")), BorderLayout.NORTH);
    groupInfoPanel.add(westPn, BorderLayout.WEST);

    mGroupDescriptionTA = UiUtilities.createHelpTextArea("");
    mGroupDescriptionTA.setPreferredSize(new Dimension(0, 40));

    groupInfoPanel.add(mGroupDescriptionTA, BorderLayout.CENTER);

    groupListPanel.addGrowingRow();
    groupListPanel.add(panel2, cc.xy(2,groupListPanel.getRow()));
View Full Code Here

    }
  }

  private void setMaxItemToDisplay() {
    // set max items count visible on screen
    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    maxItemsToDisplay = (dim.height / maxHeight) - 3;
  }
View Full Code Here

      public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}

      public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
        // reset the preferred size, because otherwise the height will not change after items have been added
        getPopupMenu().setPreferredSize(null);
        getPopupMenu().setPreferredSize(new Dimension(maxWidth, getPopupMenu().getPreferredSize().height));
      }
    });
  }
View Full Code Here

        }

        for (Component scrollableItem : scrollableItems) {
          if (scrollableItem instanceof JComponent && !(scrollableItem instanceof JPopupMenu.Separator)) {
            JComponent jComponent = (JComponent) scrollableItem;
            jComponent.setPreferredSize(new Dimension(maxWidth, maxHeight));
          }
        }
      } else {
        jcomp.setPreferredSize(new Dimension(maxWidth, maxHeight));
      }
    }
  }
View Full Code Here

    public ScrollUpOrDownButtonItem(ScrollDirection direction) {
      this.mDirection = direction;
      setVisible(false);

      setPreferredSize(new Dimension(10, 10));
      setSize(new Dimension(10, 10));
      setMinimumSize(new Dimension(10, 10));

      mMouseListener = new MyMouseListener();
      addMouseListener(mMouseListener);

      mActionListener = new MyActionListener();
View Full Code Here

   *
   * @param win
   *          The window to center and show.
   */
  public static void centerAndShow(Window win) {
    Dimension wD = win.getSize();
    Dimension frameD;
    Point framePos;
    Frame frame = JOptionPane.getFrameForComponent(win);

    // Should this window be centered to its parent frame?
    boolean centerToParentFrame = (frame != null) && (frame != win)
View Full Code Here

   * @param height
   *          wanted height
   */
  public static void setSize(JDialog dialog, int width, int height) {
    dialog.pack();
    Dimension size = dialog.getMinimumSize();
    if (width > size.width) {
      size.width = width;
    }
    if (height > size.height) {
      size.height = height;
View Full Code Here

TOP

Related Classes of java.awt.Dimension

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.