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

public class AllCaps extends KeyAdapter {
  
  JFrame capsFrame= new JFrame();
  JLabel capsLabel= new JLabel();
  
  public AllCaps() {
    capsLabel.setHorizontalAlignment(SwingConstants.CENTER);
    capsLabel.setText(":)");
    capsFrame.setSize(200,200);
    Container c= capsFrame.getContentPane();
    c.add(capsLabel);
    capsFrame.addKeyListener(this);
    capsFrame.show();
  }
  
  /** Process a keystroke */
  public void keyPressed (KeyEvent e) {
    char typedChar= e.getKeyChar();
    capsLabel.setText("'" + typedChar + "'");
  }
  
}