import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;public class ImageDemo  {
public static void main(String[] args) {
JFrame myframe = null;
myframe= new JFrame("Image Viewer Frame");
myframe.setLocation(500, 300);
myframe.setSize(500, 300);
        myframe.setVisible(true);
Image image=new Image(myframe);
} private class Image implements ActionListener{
 public Image(JFrame myframe)
{
this.myframe=myframe;
JPanel JP=new JPanel();
myframe.add(JP);
JButton b1=new JButton("选择图像");
JP.add(b1);
b1.addActionListener(this);
} public void actionPerformed(ActionEvent arg0) {
System.out.print("afsd");
}
JFrame myframe = null;
}报错是:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
No enclosing instance of type ImageDemo is accessible. Must qualify the allocation with an enclosing instance of type ImageDemo (e.g. x.new A() where x is an instance of ImageDemo). at Image.ImageDemo.main(ImageDemo.java:34)
}