Search code examples
javaswingjoptionpanextend

Using JOptionPane with Xtend


I realize it might be a very stupid question, but how do I use JOptionPane with Xtend? I can't figure it out and I've been trying to get it working for a while now.

JOptionPane.showMessageDialog(getContentPane(), message); doesn't seem to work.

Eclipse gives me this error: The method or field JOptionPane is undefined for the type MyClassName


Solution

  • Static methods or fields are accessed by double colons in Xtend:

    JOptionPane::showMessageDialog(..)
    

    Please refer to the docs for details.