Text field

hi,

i want to hide the blinking cursor for a text field which is in read only

pls help me out.

I don’t think its possible to hide the blinking cursor. However, since its read only you can remove the focus from text field .

Regards,
Azhar

hi Azhar,

i tried to remove focus , but if m explicitly clicking then its not working ,
i am using IE
plz help me

thanks

Well, since there is no direct way to achieve this, perhaps you can try this.

  1. add focus listener to your text field
  2. onFocus set the focus to other component on page.

Hope this helps.

Regards,
Azhar

i think i can’t add focus listner to read only text field.
i tried its not working…

Why shouldn’t it work. A Textfield set to ReadOnly Mode is in no way different to a “normal” Textfield when it comes to Listeners.

txt.setReadOnly(true);
txt.addFocusListener(new FocusListener() {
    @Override
    public void focus(FocusEvent event) {
        //stuff
    }
});

yeah it workd, but caret is still showing?