Since your inner class is not static, all methods of the outer class are automatically visible to the inner class, even the private one.
So just go ahead and call the method you want.
For instance,
class MyClass extends JPanel { void doStuff() { } boolean someLogic() { return 1>2; } void setupUI() { addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 && someLogic()) doStuff(); } }); } }
See the Sun Tutorial for nested classes for more on this.
source share