import javax.swing.*; import java.awt.*; import java.util.*; public class TextBoxFun { public static void main( String[] args ) { Color cream = new Color( 255, 255, 200 ); Color sky = new Color( 225, 225, 255 ); JFrame window = Window.make( "Testing", 475, 415, Color.WHITE, false, false ); TextBox tb1 = new TextBox( "Text box 1" ); TextBox tb2 = new TextBox( "Text box 2" ); tb1.addTo( window ); tb2.addTo( window ); tb1.setColor( cream ); tb2.setColor( sky ); window.setVisible( true ); Scanner stdin = new Scanner( System.in ); System.out.print( "Enter message: " ); String s1 = stdin.nextLine(); String s2 = tb2.getText(); System.out.println( "tb1) " + s1 ); System.out.println( "tb2) " + s2 ); } }