Eclipse Indigo CodePro Analytix

296 Views Asked by At

In the school scope of an audit project i am using the CodePro Analytix with Eclipse Indigo. CodePro works fine. But when i'm using java code to create JFrame (for example), it keeps showing an error "The type javax.swing.JComponent cannot be resolved. It is indirectly referenced from required .class files.".

I've searched too many websites to resolve this problem, but i couldn't find any help. I already configured the build path, but it keeps showing this error.

For an example i used this code

import java.awt.FlowLayout;
import javax.swing.*;

public class SwingExample {

public static void main(String[] args) {

    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            JFrame f = new JFrame("Swing Example Window");
            f.setLayout(new FlowLayout());
            f.add(f, new JLabel("Hello world!"));
            f.add(f, new JButton("Press me!"));
            f.pack();
            f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            f.setVisible(true);
        }
    });
}

}

And this error it the only to appear:

"The type javax.swing.JComponent cannot be resolved. It is indirectly referenced from required .class files."

Can anyone help me? All i need to do is to perfom and audit to a Java project with CodePro Analytix Tool.

0

There are 0 best solutions below