Re: SteppedComboBox problem



Roedy Green wrote:
On Sat, 29 Oct 2005 01:09:50 -0400, hilz <now@xxxxx> wrote, quoted or
indirectly quoted someone who said :

If i change this method

  public void show() {
    ....

to

  public void setVisible(boolean isVisible){
    if(!false==isVisible){
      super.hide();
      return;
    }
    ....
Why would you override setVisible?  Leave it alone!


overriding it is what makes the combo box a stepped one! it resizes the dropdown list to the longest item in the list.


if (!false == isVisible) is one heck of a roundabout way of saying

if ( isVisible )

The return is not likely needed.


I corrected myself in a reply to my OP, and actually this is what it needs to be:


    if(false==isVisible){

because if the setVisible was called with (false) then we simply need to hide it, and ofcourse return. but if we were setting it to (true) then we need to do the resizing. but this is causing a stack overflow because of infinite recursion.

Anysays, as Chris said, "In this case, since an interface declared an undeprecated show() method, the warning is just being picky anyway."

and i actually think it is not just picky, it is actually being silly!
.