Java Code



import java.awt.*;
import javax.swing.*;
public class instanceVars extends JApplet
{
   		// instance variables
	JLabel name;
	JButton go;
   	public void init( )
	{
		setLayout( new FlowLayout( ) );
		name = new JLabel( "Cookie Monster" );
		go = new JButton( "GO!" );
		add( name );
		add( go );
	}
}

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