Noeud method unexpected result?!

Help
2012-11-06
2013-05-01
  • Verhaag, G.C.H.M.

    Hi,

    Again I'm having problems with dialog windows not showing at all!

    The following code:

    for (int i=0; i<s.length(); i++) {
        JaxeElement abc = doc.elementA(i);
    }
    JOptionPane.showMessageDialog(doc.jframe,
                        " A message!", "ProjectsStats", JOptionPane.INFORMATION_MESSAGE);
    

    within plugin is rendering JOptionPane correctly. But when I want to retrieve the corresponding DOM node within the for-loop using:

    Element currNode = (Element)abc.noeud;
    

    the dialog box has disappeared, and no error messages at all!

    What am I doing wrong here?

    Regards,
    verhaaggchm

     
  • Damien Guillaume

    did you check if abc was null ? There might not be an element at a given position (like the last character in the document).

     
  • Verhaag, G.C.H.M.

    Hi,

    I put the JaxeElement abc = doc.elementA(i); command inside a try/catch block and tested for NullPointerException!

    Result NOT null!

    Regards,
    verhaaggchm

     
  • Damien Guillaume

    have you tried using SwingUtilities.invokeLater ?
    (JOptionPane.showMessageDialog should be called in the EDT)

     

Log in to post a comment.