Java Code

import javax.swing.*;
import java.awt.*;
public class JTextAreaEx extends JApplet
{
   JTextArea ta1, ta2, ta3;
   JScrollPane pane;

   public void init( )
   {
		setLayout( new FlowLayout( ) );
		ta1 = new JTextArea( );
		ta2 = new JTextArea( 4, 20 );
		ta3 = new JTextArea( "I like java." );
		add( ta1 );
		pane = new JScrollPane( ta2 );
		add( pane );
		ta3.setBackground( Color.RED );
		ta3.setForeground( Color.CYAN );
		add( ta3 );
   }
}

Back to Code Examples
©2006- by E.S.Boese. All Rights Reserved