package com.tutego.insel.ui.event;

import java.awt.event.*;
import javax.swing.*;

public class CloseWindowWithAdapter
{
  public static void main( String[] args )
  {
    JFrame f = new JFrame();
    f.setSize( 400, 400 );
    f.setVisible( true );

    f.addWindowListener( new CloseWindowAction() );
  }
}

class CloseWindowAction extends WindowAdapter
{
  @Override
  public void windowClosing( WindowEvent e ) { System.exit(0); }
}
