Rectangle cbBounds = SwingUtilities.getLocalBounds(comboBox); Rectangle abBounds = arrowButton.getBounds(); Rectangle rectForCurrentValue = new Rectangle(cbBounds.x, cbBounds.y, cbBounds.width - abBounds.width, cbBounds.height); return rectForCurrentValue;
int w = comboBox.getWidth(); int h = comboBox.getHeight(); Insets i = comboBox.getInsets(); int arrowSize = h - (i.top + i.bottom); if (arrowButton != null) { arrowSize = arrowButton.getWidth(); } return new Rectangle(i.left, i.top, w - (i.left + i.right + arrowSize), h - (i.top + i.left));
  protected Rectangle rectangleForCurrentValue()  {    Rectangle cbBounds = SwingUtilities.getLocalBounds(comboBox);    Rectangle abBounds = arrowButton.getBounds();       Rectangle rectForCurrentValue = new Rectangle(cbBounds.x, cbBounds.y,      cbBounds.width - abBounds.width, cbBounds.height);    return rectForCurrentValue;  }