Getting java.lang.IllegalStateException: This must happen in the event thread!, when disabling an action

"kmilito" <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
I am trying to disable an action outside actionPerformed(ActionEvent e) by using action.setEnabled(false), but I get the following error:


Code:
java.lang.IllegalStateException: This must happen in the event thread!
    at org.openide.awt.Actions$Bridge.propertyChange(Actions.java:929)
    at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:197)
    at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
    at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:92)
    at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
    at javax.swing.AbstractAction.firePropertyChange(AbstractAction.java:276)
    at javax.swing.AbstractAction.setEnabled(AbstractAction.java:236)



Any ideas what I am getting this error?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.