NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

listeners not registered after topcomponent restored

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
ikvaso



Joined: 05 Nov 2011
Posts: 14

PostPosted: Thu Jan 19, 2012 7:52 pm    Post subject: listeners not registered after topcomponent restored Reply with quote

My TopComponent contains JTextArea with registred listeners (KeyListener and DocumentListener)

when this topcomponent is restored during application start (when TopComponent is opened before application is closed, it is restored on application start), these listeners are not registered
when I close and re-open TopComponent, listeners are being registered and working properly

has anyone got any experience with this? I've got the same code as stated in this Geertjan's blog (so I suppose it should work, but it does not):

Code:
myTextField.getDocument().addDocumentListener(new DocumentListener() {

    public void insertUpdate(DocumentEvent arg0) {
        dummyNode.fire(true);
    }

    public void removeUpdate(DocumentEvent arg0) {
        dummyNode.fire(true);
    }

    public void changedUpdate(DocumentEvent arg0) {
        dummyNode.fire(true);
    }
});


thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo