All pastes #20220 Raw Edit

Stuff

public text v1 · immutable
#20220 ·published 2005-08-17 01:45 UTC
rendered paste body
import java.awt.*;
import java.awt.event.*;

public class CompEvent extends Frame {
  public static void main(String[] args) {
    new CompEvent();
  }
  
  static class CListener implements ComponentListener 
  {
    public void componentHidden(ComponentEvent e)
    {
      System.out.println(e);
    }
    public void	componentMoved(ComponentEvent e)
    {
      System.out.println(e);
    }
    public void	componentResized(ComponentEvent e)
    {
      System.out.println(e);
    }
    public void	componentShown(ComponentEvent e)
    {
      System.out.println(e);
    }
  }

  static class WListener implements WindowListener {
    public void windowActivated(WindowEvent e)
    {
      System.out.println(e);
    }
    public void	windowClosed(WindowEvent e)
    {
      System.out.println(e);
    }
    public void	windowClosing(WindowEvent e)
    {
      System.out.println(e);
    }
    public void	windowDeactivated(WindowEvent e)
    {
      System.out.println(e);
    }
    public void	windowDeiconified(WindowEvent e)
    {
      System.out.println(e);
    }
    public void	windowIconified(WindowEvent e)
    {
      System.out.println(e);
    }
    public void	windowOpened(WindowEvent e) 
    {
      System.out.println(e);
    }
  }
	
  public CompEvent() {
    super("ComponentEvent listener");
    addComponentListener( new CListener() );
    addWindowListener( new WListener() );
    setSize(450, 260);
    setVisible(true);
  }
}