import javax.swing.*;
import java.awt.*;
public class Check extends JApplet
{
JCheckBox isHappy;
JTextArea textarea;
public void init( )
{
setLayout( new FlowLayout( ) );
isHappy = new JCheckBox( "Happy?", true );
textarea = new JTextArea( 3,10);
if ( isHappy.isSelected( ) )
textarea.setText( "You're so happy!" );
else
{
textarea.setText( "Why not happy?" );
}
add( isHappy );
add( textarea );
}
}