Re: SteppedComboBox problem
- From: Chris Smith <cdsmith@xxxxxxx>
- Date: Fri, 28 Oct 2005 23:28:16 -0600
hilz <now@xxxxx> wrote:
> I am using the SteppedComboBox that i got from here:
>
> http://www.codeguru.com/java/articles/163.shtml
>
> and when i compile it using JDK 5.0 with -Xlint:deprecation i get the
> deprecation warning about the SteppedComboBoxUI.show() method being
> deprecated.
Yes. That's because BasicComboPopup is a JComponent, and the show()
method of JComponent is indeed deprecated.
> If i change this method
>
> public void show() {
> ....
>
> to
>
> public void setVisible(boolean isVisible){
> if(!false==isVisible){
> super.hide();
> return;
> }
> ....
>
> it compiles fine with no deprecation warnings, but when i run it, and
> right when i click on the combo box to expand its popup list, i get a
> stack overflow exception shown at the end of this message.
Yes, the code you ellipsed contains a call to show(Component,int,int)
and that in turn calls setVisible, resulting in your infinite loop. The
easiest way to avoid this is to go ahead and ignore the deprecation
warning. In this case, since an interface declared an undeprecated
show() method, the warning is just being picky anyway.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
.
- References:
- SteppedComboBox problem
- From: hilz
- SteppedComboBox problem
- Prev by Date: Re: SteppedComboBox problem - correction
- Next by Date: Swing Dockable Windows
- Previous by thread: Re: SteppedComboBox problem - correction
- Next by thread: Re: SteppedComboBox problem
- Index(es):
Relevant Pages
|