No enclosing instance of type E is accessible.
2017-11-20 21:37
639 查看
No enclosing instance of type E is accessible.
静态方法(main)中调用内部类,会出现这样的问题;
学习了:https://www.cnblogs.com/runnigwolf/p/5570810.html
http://blog.csdn.net/sunny2038/article/details/6926079
静态方法(main)中调用内部类,会出现这样的问题;
学习了:https://www.cnblogs.com/runnigwolf/p/5570810.html
http://blog.csdn.net/sunny2038/article/details/6926079
public class SwingObserverExample { public static void main(String[] args) { JFrame jFrame = new JFrame(); JButton jButton = new JButton("Should I do it?"); jButton.addActionListener(new SwingObserverExample().new AngelListener()); jButton.addActionListener(new DevilListener()); jFrame.getContentPane().add(jButton); jFrame.setVisible(true); } class AngelListener implements ActionListener{ @Override public void actionPerformed(ActionEvent e) { System.out.println("Don't do it!"); } } static class DevilListener implements ActionListener{ @Override public void actionPerformed(ActionEvent e) { System.out.println("Just do it!"); } } }
相关文章推荐
- Java出现No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosin
- No enclosing instance of type recursion is accessible.
- 当Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- android No enclosing instance of type BasicActivity is accessible. Must qualify the allocation with
- No enclosing instance of type Multh is accessible. Must qualify the allocati
- 再学Java 之 解决No enclosing instance of type * is accessible
- No enclosing instance of type AddressDemo1 is accessible. Must qualify the allocation with an enclos
- Java编译时出现No enclosing instance of type XXX is accessible.
- No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instanc
- No enclosing instance of type Hello is accessible
- [Java]Error:No enclosing instance of type E is accessible. Must qualify the allocation with an enclo
- 【JAVA001】No enclosing instance of type XXX is accessible.
- Java错误:No enclosing instance of type MyClass is accessible.
- No enclosing instance of the type RegisterActivity is accessible
- - No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing in
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Java编译错误“No enclosing instance of type AA is accessible. Must qualify the allocation with an enclosing instance of type SimpleT
- No enclosing instance of type UpdataInfoParser is accessible. Must qualify the allocation with an en
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing