import java.awt.*; import java.applet.Applet; import java.io.*; import java.net.*; public class ps3e2 extends Applet { Choice upLow = new Choice(); TextField tf = new TextField(20); TextField tf2 = new TextField(20); Button btn1 = new Button("shazam!"); Label prompt = new Label( "enter a word please: "); public void init() { add(upLow); add(btn1); add(prompt); add(tf); upLow.addItem("UPPER CASE"); upLow.addItem("lower case"); } public boolean action( Event e, Object o ) { String str1; String str2; if (e.target == btn1) { str1 = tf.getText(); if (upLow.getSelectedIndex() == 0) str1 = str1.toUpperCase(); else str1 = str1.toLowerCase(); tf.setText(str1); } return true; } public void paint(Graphics g) { } }