Re: SteppedComboBox problem
- From: hilz <now@xxxxx>
- Date: Mon, 31 Oct 2005 06:42:02 -0500
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! .
- References:
- SteppedComboBox problem
- From: hilz
- Re: SteppedComboBox problem
- From: Roedy Green
- SteppedComboBox problem
- Prev by Date: Re: JDK 1.5.0_05 won't load applets from the Internet?
- Next by Date: problem with multiple internal frames for drawing different graphs
- Previous by thread: Re: SteppedComboBox problem
- Next by thread: Swing Dockable Windows
- Index(es):