Package java.awt

Examples of java.awt.LayoutManager.preferredLayoutSize()


    jBtExtraControls.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        Dimension d = p.getPreferredSize();
        if(d.width==0 || d.height==0) {
          LayoutManager lm = p.getLayout();
          Dimension d2 = lm.preferredLayoutSize(p);
          p.setPreferredSize(d2); jTbTools.revalidate();
          /*
          // this piece of code adds in an animation
          // for popping out the extra controls panel
          Thread th = new Thread() {
View Full Code Here


    jBtExtraControls.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        Dimension d = p.getPreferredSize();
        if(d.width==0 || d.height==0) {
          LayoutManager lm = p.getLayout();
          Dimension d2 = lm.preferredLayoutSize(p);
          p.setPreferredSize(d2); jTbTools.revalidate();
          /*
          // this piece of code adds in an animation
          // for popping out the extra controls panel
          Thread th = new Thread() {
View Full Code Here

        assertEquals("iconButton", iconButtonBounds, pane.iconButton.getBounds());
        assertEquals("maximizeButton", maximizeButtonBounds, pane.maxButton.getBounds());
        assertEquals("closeButton", closeButtonBounds, pane.closeButton.getBounds());
        // minimumLayoutSize(), preferredLayoutSize() implementations
        assertTrue("", layout.minimumLayoutSize(pane) != null);
        assertTrue("", layout.preferredLayoutSize(pane) != null);
    }

    @SuppressWarnings("deprecation")
    public void testSystemMenuBar() {
        JMenuBar menuBar = pane.new SystemMenuBar();
View Full Code Here

            assertEquals("palette: closeButton", new Rectangle(189, 11, 8, 8), pane
                    .getComponent(0).getBounds());
        }
        // minimumLayoutSize(), preferredLayoutSize() implementations
        assertTrue("", layout.minimumLayoutSize(pane) != null);
        assertTrue("", layout.preferredLayoutSize(pane) != null);
    }
}
View Full Code Here

  public Dimension getPreferredSize(JComponent x)
  {
    Dimension pref = null;
    LayoutManager layout = frame.getLayout();
    if (frame == x && layout != null)
      pref = layout.preferredLayoutSize(frame);
    else
      pref = new Dimension(100, 100);
    return pref;
  }
View Full Code Here

    jBtExtraControls.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        Dimension d = p.getPreferredSize();
        if(d.width==0 || d.height==0) {
          LayoutManager lm = p.getLayout();
          Dimension d2 = lm.preferredLayoutSize(p);
          p.setPreferredSize(d2); jTbTools.revalidate();
          /*
          // this piece of code adds in an animation
          // for popping out the extra controls panel
          Thread th = new Thread() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.