JPanel rightSide = new JPanel() { public Dimension getPreferredSize() { int w = Math.max(optionPane.getSize().width, minimumWidth); Insets i = optionPane.getInsets(); Dimension orig = super.getPreferredSize(); Dimension value = new Dimension(w - i.left - i.right - iconSize, orig.height); return value; } };
JPanel rightSide = new JPanel();
  protected Container createMessageArea()  {    JPanel messageArea = new JPanel();    messageArea.setLayout(new BorderLayout());    addIcon(messageArea);    JPanel rightSide = new JPanel()    {    public Dimension getPreferredSize()    {	  int w = Math.max(optionPane.getSize().width, minimumWidth);      Insets i = optionPane.getInsets();      Dimension orig = super.getPreferredSize();      Dimension value = new Dimension(w - i.left - i.right - iconSize,                                      orig.height);      return value;    }    };        rightSide.setLayout(new GridBagLayout());    GridBagConstraints con = createConstraints();    addMessageComponents(rightSide, con, getMessage(),                         getMaxCharactersPerLineCount(), false);    if (optionPane.getWantsInput())      {	Object[] selection = optionPane.getSelectionValues();//	if (selection == null)//	  inputComponent = new JTextField();//	else if (selection.length < 20)//	  inputComponent = new JComboBox(selection);	// FIXME: Uncomment when the widgets are done.	if (selection == null)	  inputComponent = null;	else	  inputComponent = new JList(selection);	if (inputComponent != null)	  {	    addMessageComponents(rightSide, con, inputComponent,	                         getMaxCharactersPerLineCount(), true);	    resetSelectedValue();	    selectInitialValue(optionPane);	  }      }    messageArea.add(rightSide, BorderLayout.EAST);    return messageArea;  }