We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
[JDK1.1]
import java.awt.*;
import java.awt.event.*;
public class UpperTF extends Frame {
public static void main(String argv[]) {
new UpperTF().setVisible(true);
}
public UpperTF() {
setLayout(new FlowLayout());
TextField tf = new TextField(10);
add(tf);
tf.addKeyListener(
new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (Character.isLetter(e.getKeyChar()))
e.setModifiers(Event.SHIFT_MASK);
}
});
pack();
addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
);
}
public Dimension getPreferredSize() {
return new Dimension(200,200);
}
}