Examples of preferredLayoutSize()


Examples of java.awt.LayoutManager.preferredLayoutSize()

    /* This has to deal with the fact that the title may be wider than
       the widest child component.
       */
    public Dimension getPreferredSize(JComponent c) {
        LayoutManager layout = c.getLayout();
        Dimension d = layout.preferredLayoutSize(c);
        String title = ((JPopupMenu)c).getLabel();
        if (titleFont == null) {
            UIDefaults table = UIManager.getLookAndFeelDefaults();
            titleFont = table.getFont("PopupMenu.font");
        }
View Full Code Here

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

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

Examples of java.awt.LayoutManager.preferredLayoutSize()

        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

Examples of java.awt.LayoutManager.preferredLayoutSize()

            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

Examples of java.awt.LayoutManager.preferredLayoutSize()

  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

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

Examples of javax.swing.BoxLayout.preferredLayoutSize()

 
  private void testBasic(TestHarness harness)
  {
    JPanel container = new JPanel();
    BoxLayout layout = new BoxLayout(container, BoxLayout.X_AXIS);
    harness.check(layout.preferredLayoutSize(container), new Dimension(0, 0));
    container.setBorder(BorderFactory.createEmptyBorder(1, 2, 3, 4));
    harness.check(layout.preferredLayoutSize(container), new Dimension(6, 4));
   
    // must call with original container
    boolean pass = false;
View Full Code Here

Examples of javax.swing.BoxLayout.preferredLayoutSize()

  {
    JPanel container = new JPanel();
    BoxLayout layout = new BoxLayout(container, BoxLayout.X_AXIS);
    harness.check(layout.preferredLayoutSize(container), new Dimension(0, 0));
    container.setBorder(BorderFactory.createEmptyBorder(1, 2, 3, 4));
    harness.check(layout.preferredLayoutSize(container), new Dimension(6, 4));
   
    // must call with original container
    boolean pass = false;
    try
      {
View Full Code Here

Examples of javax.swing.BoxLayout.preferredLayoutSize()

   
    // must call with original container
    boolean pass = false;
    try
      {
        /*Dimension result =*/ layout.preferredLayoutSize(new JPanel());
      }
    catch (AWTError e)
      {
        pass = true;
      }
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.