I am a beginner at Java programming. I wrote these lines of code using JOptionPane but continues to obtain an error message
import javax.swing.JOptionPane;
public class JOpt
{
public static void main(String[] args)
{
JOptionPane.showMessageDialog(null, "Message" , JOptionPane.INFORMATION_MESSAGE);
}
}
Error message
Access restriction: The type JOptionPane is not accessible due to restriction on required library C:\Program Files (x86)\Java\jre7\lib\rt.jar
Access restriction: The field INFORMATION_MESSAGE from the type JOptionPane is not accessible due to restriction on required library C:\Program Files (x86)\Java\jre7\lib\rt.jar
at JOpt.main(JOpt.java:10)
What could the problem be
Is something wrong with my compiler