javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
EditorCookie ck = dataObj.getCookie(EditorCookie.class);
final Observable ec = dataObj.getCookie(Observable.class);
if (ck != null && ec != null) {
ec.open();
//open the document
JEditorPane[] p = ck.getOpenedPanes();
if (p.length > 0) {
//Need to do this since we're disabling the window system's
//auto focus mechanism