是否有可能以某种方式调用这样的实例?我知道invokeLater需要一个runnable,我可以在该方法中传递一个新实例,但是我需要能够在调用它后访问该实例。
public class Main {
// Create a new instance of the applet frame
private static final AppletFrame APPLET_FRAME = new AppletFrame();
public static void main(String[] args) {
// Somehow invoke that applet frame without creating a new one here
so we can access it later on like below.
SwingUtilities.invokeLater(APPLET_FRAME);
// Then if this is possible I can access the invoked instance still.
// APPLET_FRAME.doSomething();
}
}