hi all,
I'm working on jdk1.3 and need to simulate the setFocusable()
of jdk1.4 version (i'm not allowed to use jdk1.4 due to server side
restrictions i.e WSAD doesn't support 1.4 as of now.)
I tried to simulate the method as follows

class MyCombo extends JComboBox {
    private boolean bFocusable = false;

    public MyCombo() {
      addFocusListener(new FocusAdapter() {
           public void focusGained(FocusEvent fe) {
                System.out.println("abhay: focus gained");
           }
      });
   }
    ...
    ...

    public void setFocusable(boolean abFocusable) {
        this.bFocusable = abFocusable;
    }

    public boolean isFocusTraversable() {
        System.out.println("abhay: isFocusTraversible invoked !");
        return bFocusable;
    }
}

which ideally should work ... but i dont see it working ... the control
still is transfered to 'MyCombo'. To add to the confusion I implemented a
focusListener as coded above and found that 'isFocusTraversable' gets
invoked but the focusGained method is not .
Can anyone explain where am i wrong ?
Why such weird behaviour ?
Are there any workarounds ?
 

regards
abhay ____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to