loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight);
int buttonWidth = maxIcon.getIconWidth(); loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight);
    public void layoutContainer(Container c)    {      Dimension size = c.getSize();      Insets insets = c.getInsets();      int width = size.width - insets.left - insets.right;      int height = size.height - insets.top - insets.bottom;      // MenuBar is always present and located at the top left corner.      Dimension menupref = menuBar.getPreferredSize();      menuBar.setBounds(insets.left, insets.top, menupref.width, height);      int loc = width + insets.left - 1;      int top = insets.top + 1;      int buttonWidth = height - 2;      int buttonHeight = height - 4;      if (closeButton.isVisible())        {	  loc -= buttonWidth + 2;	  closeButton.setBounds(loc, top, buttonWidth, buttonHeight);        }      if (maxButton.isVisible())        {	  loc -= buttonWidth + 2;	  maxButton.setBounds(loc, top, buttonWidth, buttonHeight);        }      if (iconButton.isVisible())        {	  loc -= buttonWidth + 2;	  iconButton.setBounds(loc, top, buttonWidth, buttonHeight);        }      if (title != null)	title.setBounds(insets.left + menupref.width, insets.top,	                loc - menupref.width - insets.left, height);    }