标题## 1. 列表项
我通过扩展 JFrame 类将代码编写为一个类中的设计部分,以及另一个类(不是内部类)中按钮的动作侦听器,最后对于 main 方法,我采用了单独的类。在侦听器类中,我正在关闭当前窗口并打开新窗口。我可以打开新窗口。但我不能关闭现有的窗口。请帮助我。(我无法访问 setVisible() 方法)谢谢hari。这里我的代码是
CredentialsForm .java
public CredentialsForm()
{
btnGetSessionKey.addActionListener(new ButSesKeyListener());
btnGoToMessaging.addActionListener(new ButGoToMesListener());
btnGoToMessaging.setFont(new Font("Arial", Font.PLAIN, 12));
btnGetSessionKey.setFont(new Font("Arial", Font.PLAIN, 12));
lblAutomationId.setFont(new Font("Arial", Font.PLAIN, 12));
lblYouSessionKey.setFont(new Font("Arial", Font.PLAIN, 12));
lblEncryptionKey.setFont(new Font("Arial", Font.PLAIN, 12));
lblSingleSignOn.setFont(new Font("Arial", Font.PLAIN, 12));
lblUserName.setFont(new Font("Arial", Font.PLAIN, 12));
lblEmail.setFont(new Font("Arial", Font.PLAIN, 12));
tfGoToMessaging.setColumns(10);
tfGetSessionKey.setColumns(10);
tfEncryptionKey.setColumns(10);
tfSingleSignOn.setColumns(10);
tfUserName.setColumns(10);
tfEmail.setColumns(10);
tfAutomationId.setColumns(10);
initGUI();
}