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());
}
});
}