Re: SteppedComboBox problem



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
.



Relevant Pages

  • SteppedComboBox problem
    ... and when i compile it using JDK 5.0 with -Xlint:deprecation i get the deprecation warning about the SteppedComboBoxUI.showmethod being deprecated. ... public void setVisible{ ... Does anyone know how can i remove this deprecation message and yet keep this combo box working? ...
    (comp.lang.java.gui)
  • Re: VC++2005???
    ... You dont have to upgrade but the upgrade is relatively painless. ... Deprecation of functions was not a big deal. ... Make sure you compile all projects with VS2005. ...
    (microsoft.public.vc.mfc)
  • Re: [PATCH] sysctl: Allow /proc/sys without sys_sysctl
    ... This should catch any remaining user space code that cares, ... ** the sysctlbinary interface. ... So the combination of the two patches and makes the deprecation official, ... and makes it a compile time option so we can disable sys_sysctl now, ...
    (Linux-Kernel)