Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javax.swing.SwingUtilities.invokeLater make my program slow

795748May 30 2010 — edited Jun 1 2010
i am writing a program in which i am implementing documentlistener
to communicating between two frames
if i write my code with javax.swing.SwingUtilities.invokeLater it makes my program slow
and if i write without this thread safe quality then this is fast but giving me runtime exception
what i do to make my program better
kindly suggest
public void insertUpdate(DocumentEvent e) {
            updateLog(e, "inserted into");
        }
        public void removeUpdate(DocumentEvent e) {
            updateLog(e, "removed from");
        }
        public void changedUpdate(DocumentEvent e) {
            //Plain text components don't fire these events.
        }

        public void updateLog(DocumentEvent e, String action) {
            Document doc = (Document)e.getDocument();
javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
tf4.setText(lbl.getText());
            }
        });
} 
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2010
Added on May 30 2010
4 comments
431 views