我有一个类,其中包含内部类。我想发送等于顶级类的值,但是“this”发送的是内部类的值。我能做些什么?
package Controller;
public class MessageFrameListener{
private MessageFrame mf;
private User us;
private Contact cn;
private Timer timer;
private Running run;
private ListFrame lf;
public MessageFrameListener(ListFrame l_f, MessageFrame m_f, User u_s, Contact c_n, Running r_n){
run = r_n;
mf = m_f;
us = u_s;
cn = c_n;
lf = l_f;
m_f.addButtonListener(new SButtonListener());
m_f.addWinListener(new FrameListener());
timer = new Timer(500,new timerListener());
timer.start();
}
public class FrameListener implements WindowListener{
@Override
public void windowClosing(WindowEvent e) {
timer.stop();
timer = null;
mf.close();
lf.removeMFL(this));
}
}
}
所以,这条线
lf.removeMFL(this));
通过这个发送“FrameListener”,但我想发送“MessageFrameListener”