Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tetris;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.WindowEvent;
- import java.awt.event.WindowListener;
- import javax.swing.JOptionPane;
- public class Listener_Adapter implements WindowListener, ActionListener{
- public Listener_Adapter(){};
- public void windowClosing(WindowEvent arg0) {
- System.exit(0);
- }
- public void windowActivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
- }
- public void windowClosed(WindowEvent arg0) {
- // TODO Auto-generated method stub
- }
- public void windowDeactivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
- }
- public void windowDeiconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
- }
- public void windowIconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
- }
- public void windowOpened(WindowEvent arg0) {
- // TODO Auto-generated method stub
- }
- public void actionPerformed(ActionEvent e){
- if(e.getActionCommand().equals("1")){
- new Tetris_Frame();
- }
- if(e.getActionCommand().equals("2")){
- ;
- }
- if(e.getActionCommand().equals("3")){
- new Options_Frame();
- }
- if(e.getActionCommand().equals("4")){
- int confirm = JOptionPane.showOptionDialog(null, "Really wanna close the game?", "Exit Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
- if (confirm == 0) {
- System.exit(0);
- }
- }
- if(e.getActionCommand().equals("Back to menu")){
- new Main_Frame();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement