button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new SecondFrame().setVisible(true);
FirstFrame.this.dispose(); // if you want the first frame to close
}
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请查看如何编写动作侦听器.
归档时间: |
|
查看次数: |
7893 次 |
最近记录: |