I don't think Java has direct syntax for this unless you start playing with reflection (which, of course, is possible, but I don't find it very clean).
The moment you want to make a call, your "this" refers to the anonymous subclass of MouseAdapter.
The cleanest approach may be to create a private method, let it call X in TheTable and ask the adapter to execute this function.
Now, since this method X is in TheTable, it does not know that it is inside the panel, so it has no way to activate this function. If you are sure that each table is inside the panel, then you can add the panel link field to your Table class, initialize it when you create it (you may need to change the constructor to OnePanel), and then make a call from the method in TheTable.
If the panel method ultimately tries to explore not part of JPanel, you may need to create and pass interfaces.
source share